CN111447445B - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN111447445B
CN111447445B CN202010179999.6A CN202010179999A CN111447445B CN 111447445 B CN111447445 B CN 111447445B CN 202010179999 A CN202010179999 A CN 202010179999A CN 111447445 B CN111447445 B CN 111447445B
Authority
CN
China
Prior art keywords
layer
frame image
layers
target
target frame
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.)
Active
Application number
CN202010179999.6A
Other languages
Chinese (zh)
Other versions
CN111447445A (en
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 CN202010179999.6A priority Critical patent/CN111447445B/en
Publication of CN111447445A publication Critical patent/CN111447445A/en
Application granted granted Critical
Publication of CN111447445B publication Critical patent/CN111447445B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • 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
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

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 data delay caused by blocking during video transmission. The specific technical scheme is as follows: the method comprises the steps of obtaining a target frame image and a preset layer corresponding to the target frame image, obtaining preset transmission resources required by transmission of the preset layer in the target frame image by carrying out layering processing on the target frame image, determining the target layer in a cyclic iteration mode according to the comparison between the preset transmission resources and current transmission resources, enabling a code stream required by the target layer to approach a bandwidth, determining a target layer number matched with the current bandwidth, and carrying out coding transmission on the layer corresponding to the target layer number through the current transmission resources. The present disclosure is for data transmission.

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 video encoding and decoding transmission, the content needing to be encoded is reduced by adopting modes of inter-frame prediction, intra-frame prediction and the like, and then different encoders are adopted for encoding. The inter-frame prediction refers to that a change macro block and an exchange macro block in a target frame are found out by comparing pixel distribution between the target frame and a reference frame, and then an encoder is used for encoding the change macro block. When a picture scene is switched in video transmission, because the number of change macro blocks to be coded in a target frame is increased, the stream coded by the target frame is large. When the network resource for transmitting the video has a large limit on the instantaneous transmission bandwidth, therefore, for the encoded target frame image, if the encoded stream is so large as to exceed the limited bandwidth of the network resource, network congestion may be caused, and further, the subsequent code stream cannot be transmitted normally, resulting in video blocking or data packet loss.
Therefore, in order to improve the network congestion caused by the overlarge code stream caused by the transmission of the I frame or the picture switching, in the prior art, a code rate control scheme is adopted to solve the problem. Specifically, rate control refers to controlling the data amount of the encoded video stream in a unit time by adjusting the encoding parameters, so that the generated bit stream meets the requirements of various applications. The code rate control is characterized in that a data buffer area is arranged, and the data throughput in unit time is controlled according to the real-time bandwidth state, so that data transmission can be carried out smoothly, and the peak value of an area is avoided.
Disclosure of Invention
The embodiment of the disclosure provides a data transmission method and device, which can solve the problem of data delay caused by blocking when a video is transmitted. 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 and a preset layer number M corresponding to the target frame image, wherein the target frame image comprises N layers, and the preset layer number M refers to the layer number of a last frame image corresponding to the target frame image, which is transmitted;
when the target frame image comprises a change macro block, acquiring a preset transmission resource corresponding to the preset layer number M according to the preset layer number M, wherein the change 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 in the target frame image according to the comparison result of the preset 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 method further comprises:
after the transmission of the layer corresponding to the target layer number is finished, acquiring residual transmission resources, wherein the residual transmission resources refer to residual transmission resources after the target transmission resources transmit the layer corresponding to the target layer number;
and transmitting the residual layers in the target frame image layer by layer according to the residual transmission resources, and updating the preset layer number M.
In one embodiment, the method further comprises:
when the target frame image is a first frame image in a target video, acquiring target transmission resources and transmission resources corresponding to each layer in the N layers of images;
transmitting each layer of image layer by layer through the target transmission resource, 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 target frame image is transmitted completely;
and acquiring the transmitted layer number of the target frame image, and setting the layer number as a preset layer number M.
In one embodiment, the method further comprises:
when the target frame image does not include the change macro block, obtaining a layer which is not completely transmitted in the previous frame image corresponding to the target frame image;
and transmitting the layers which are not transmitted in the previous frame of image.
In one embodiment, the transmitting layers in the previous frame of image that are not completely transmitted in the method includes:
acquiring the number of layers of a transmitted layer corresponding to each macro block in a previous frame image corresponding to the target frame image;
if the number of layers of the transmitted layers is different, sequentially transmitting each layer of layer which is not transmitted in the previous frame of image layer by layer according to the number of layers of the transmitted layers, acquiring residual transmission resources after each layer of layer is transmitted, and transmitting the next layer of 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 transmission of the previous frame of image is finished.
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 configured to obtain a target frame image and a preset number of layers M corresponding to the target frame image, where the target frame image includes N layers, and the preset number of layers M is a number of layers of a last frame image corresponding to the target frame image, where the last frame image has been transmitted;
the processor is configured to, when the target frame image includes a changed macro block, obtain a preset transmission resource corresponding to the preset layer number M according to the preset layer number M, where 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 in the target frame image according to the comparison result of the preset transmission resource and the target transmission resource;
the transmitter is configured to transmit the layer corresponding to the target layer number in the target frame image.
In one embodiment, the processor in the apparatus is further configured to,
after the transmission of the layer corresponding to the target layer number is finished, acquiring residual transmission resources, wherein the residual transmission resources refer to residual transmission resources after the target transmission resources transmit the layer corresponding to the target layer number;
and transmitting the residual layers in the target frame image layer by layer according to the residual transmission resources, and updating the preset layer number M.
In one embodiment, the processor in the apparatus is further configured to,
when the target frame image is a first frame image in a target video, acquiring target transmission resources and transmission resources corresponding to each layer in the N layers of images;
transmitting each layer of image layer by layer through the target transmission resource, 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 target frame image is transmitted completely;
and acquiring the transmitted layer number of the target frame image, and setting the layer number as a 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 change macro block, obtaining a layer which is not completely transmitted in the previous frame image corresponding to the target frame image;
and transmitting the layers which are not transmitted in the previous frame of image.
In one embodiment, the processor in the apparatus is further configured to,
acquiring the number of layers of a transmitted layer corresponding to each macro block in a previous frame image corresponding to the target frame image;
if the number of layers of the transmitted layer is different, sequentially transmitting each layer of the layer which is not transmitted in the previous frame of image layer by layer according to the number of layers of the transmitted layer, acquiring the residual transmission resources after each layer of the layer is transmitted, and transmitting the next layer of the layer through the residual transmission resources when the residual transmission resources meet the preset conditions until the residual transmission resources do not meet the preset conditions or the transmission of the previous frame of image is finished.
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. 1a is a quantization diagram of a data transmission method provided by an embodiment of the present disclosure;
fig. 1b is a schematic layered diagram of a data transmission method according to an embodiment of the present disclosure;
fig. 2 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.
Example one
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.
The target frame image is an image frame in the target video.
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.
The specific layering process may include the following steps:
step one, discrete cosine transform is carried out on a target frame image.
The method provided by the disclosure firstly carries out block processing on a target frame image by adopting a JPEG image coding mode, for example, a region to be coded can be divided into 8 × 8 macro blocks, then each macro block is subjected to Discrete Cosine Transform (DCT), so that macro block data is divided into a high frequency part and a low frequency part in a frequency domain, wherein the low frequency part is concentrated at the upper left corner of each 8 × 8 macro block, the high frequency part is concentrated at the lower right corner, and a discrete cosine transform calculation formula is as follows:
Figure BDA0002412171020000051
when w is equal to 0, the total weight of the compound,
Figure BDA0002412171020000052
when c (w) is 1, when w is 1,2, …, 7;
in the formula, N is the number of pixels in the horizontal and vertical directions, and N is 8 since the macroblock matrix size is 8 × 8. After the 8 × 8 macroblock matrix is subjected to DCT transform, an 8 × 8 transform coefficient matrix is generated, where the upper left corner F (0,0) is the macroblock pixel data mean value, which is called DC coefficient or DC coefficient, and the remaining 63 coefficients represent the magnitudes of horizontal spatial frequency and vertical spatial frequency components (high frequency components), which are called AC coefficient or AC component.
And step two, macroblock quantization.
In the method, in order to compress the size of the image to the maximum extent, the visual redundancy of human eyes is fully considered, namely the sensitivity coefficient of the human eyes to low-frequency components is far higher than that of high-frequency components, so that the image data after DCT (discrete cosine transformation) can be quantized and rearranged. Quantization is the result obtained by using the corresponding values of the pixel value/quantization table, so that the quantization table can be set to make the upper left corner smaller and the lower right corner larger for suppressing the high frequency component and keeping the low frequency component, as shown in fig. 1 a.
And step three, layering treatment.
In the method of the present disclosure, the image is scanned, for example, the 8 × 8 macroblock matrix becomes a 1 × 64 row array after being Zigzag scanned.
Analyzing the transformed row array of 1 × 64, it can be found that the data distribution rule of the array depends greatly on the pixel distribution of the macroblock in the image, and if the macroblock in the image is a pure color, it means that there is only a low-frequency component in the macroblock, so there is only a DC1 component in the array, and the AC component is 0. If the image contains high frequency information, the DC and AC components in the array are mostly non-zero. According to the data distribution rule of the arrays, the scheme subdivides 1 x 64 row array into 17 layers, and the data layering is shown in the following figure 1 b.
The low frequency components described above represent areas of the image where the luminance or grey value changes slowly, i.e. large flat areas of the image, describing the main part of the image. The high frequency components correspond to portions of the image where the change is severe, i.e., edges or noise and detailed portions of the image.
Furthermore, the method provided by the present disclosure adopts a huffman coding strategy for each layer of coding mode, and the reduction of the coding rule is that for the DC component in the macroblock array, because the DC coefficient difference between two adjacent macroblocks is very small, they are coded by differential coding DPCM, i.e. the difference between the DC coefficients of adjacent sub-macroblocks is coded. For the other 63 AC components on the macroblock, run length coding (RLE) is used because the number of "0" coefficients in the components is large. DC. And after the AC coefficient is subjected to differential run-length coding, performing Huffman entropy coding to obtain a coded data code stream.
Through the division processing, the direct current component and the alternating current component in the target frame image can be distinguished, for example, the first layer image only contains the direct current component, the alternating current component is gradually added into the subsequent layers, so that the image can be slowly distinguished into a plurality of layers from the change of brightness or gray value, and the effect of image coding is gradually clear through layer-by-layer coding of the plurality of layers.
Based on the layered images, when encoding, the direct current component can be transmitted first, and then the alternating current component is transmitted, that is, the layer number is transmitted from low to high, so that the encoding quality is changed from low to high, and the image display effect is gradually improved from fuzzy.
Before the preset number of layers M is obtained, it is required to determine whether the target frame image is the first frame image.
Example one: when the target frame image is a first frame image in a target video, determining a preset transmission resource required by each layer of image frame in the target frame image;
acquiring target transmission resources, namely current transmission resources;
when a first preset transmission resource corresponding to a first layer is smaller than a current transmission resource, transmitting the first layer in the target frame image through the target transmission resource;
after the first layer image layer is transmitted, acquiring residual transmission resources, wherein the residual transmission resources refer to the bandwidth left after the target transmission resources transmit the first layer image;
and when the residual transmission resources are larger than the transmission resources required by the second layer, transmitting the second layer of the image layer through the residual transmission resources until the residual transmission resources are smaller than the preset resources required by the X-th layer of the image, acquiring the number of layers of the target frame image after transmission is finished, and setting the number of the layers as the preset number X.
Namely, when encoding, circularly comparing each layer of converted code stream to be transmitted with the current real-time bandwidth, and finding out the number of encoding layers closest to the current bandwidth environment, namely, a preset layer, wherein the preset layer can provide reference for determining the number of image layers allowed by the current bandwidth environment when a subsequent frame image is encoded and transmitted.
And example two, when the target frame image is not the first frame image in the target video, acquiring a preset layer number M, where the preset layer number M is the layer number of the last frame image corresponding to the target frame image, which has been transmitted.
By acquiring the preset number of layers, the image layers which can be allowed to be transmitted under the condition of the current transmission resource can be known. Namely, each layer of converted code stream to be transmitted is compared with the current real-time bandwidth.
When the target frame image is not the first frame image, the number of coding layers closest to the current bandwidth environment can be determined according to the number of transmitted layer layers corresponding to the previous frame image, and the difference between the transmission resource required by each layer of layer and the current transmission resource does not need to be compared circularly from the first layer image, so that the data processing resource is saved, and the data processing efficiency is improved.
102. And when the target frame image comprises the changed macro block, acquiring the preset transmission resource corresponding to the preset layer number M according to the preset layer number M.
The preset transmission resource refers to a transmission resource required for transmitting the first layer to the Mth layer in the target frame image.
The change macro block is determined according to the comparison result between the target frame image and the previous frame image frame.
In an alternative embodiment, when the target image frame does not include the changed macroblock, the method provided by the present disclosure further includes:
when the target frame image does not include the change macro block, obtaining a layer which is not transmitted in the previous frame image and corresponds to the target frame image;
and transmitting the layers which are not transmitted completely.
In an optional implementation, the transmitting layers that are not completely transmitted in the previous frame of image in the method provided by the present disclosure includes:
acquiring the number of layers of transmitted layers corresponding to each macro block in a previous frame image corresponding to the target frame image;
if the number of layers of the transmitted layers is different, sequentially transmitting each layer of layers which are not transmitted in the previous frame of image layer by layer according to the number of layers of the transmitted layers, acquiring residual transmission resources after each layer of layers is transmitted, and transmitting the next layer of layers 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.
For example: judging whether the layer number X of a first macro block layer divided by the whole previous frame is consistent with the layer number Y of a second macro block, if the layer number X of the first macro block layer is 7 and the layer number Y of the second macro block is 5, preferentially coding the macro block with the lower layer number of the transmitted layer, namely, the second macro block, judging whether the layer number of the macro block of the lower layer reaches the code stream close to the higher layer, namely, the 5 th layer to the 6 th layer and the 5 th layer to the 7 th layer, finding the conversion layer number closest to the current bandwidth environment, if the conversion layer number closest to the current bandwidth environment is the highest layer 7, judging whether the current transmission resource has an excess code stream, if so, updating the transmitted macro block to be 7, coding the macro block of the lower layer to the adjacent higher layer, and so on until the transmission reaches the 17 th layer. 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.
103. And determining the number of target layers in the target frame image according to the comparison result of the preset transmission resource and the target transmission resource.
In the method provided by the present disclosure, determining the number of target layers in the target frame image according to the comparison result between the preset transmission resource and the target transmission resource may include:
when the comparison result of the preset transmission resource and the target transmission resource is consistent, transmitting M layers;
when the preset transmission resource is smaller than the target transmission resource, determining that the target layer is an M layer;
and when the preset transmission resource is larger than the target transmission resource, acquiring the transmission resource required by the M-1 layer, and judging a comparison result of the transmission resource required for transmitting the M-1 layer and the target transmission resource until the comparison result is consistent.
104. And transmitting the layers corresponding to the target layer number in the target frame image.
In an optional embodiment, after the transmission of the layers corresponding to the number of target layers in the target frame image, the method provided by the present disclosure further includes performing coding processing on the second layer to the nth layer on the entire frame, and counting a transition code stream required by coding each layer of image, to find the number of transition layers closest to the current bandwidth environment:
after the transmission of the layers corresponding to the target layer number is finished, acquiring residual transmission resources, wherein the residual transmission resources refer to the bandwidth left after the target transmission resources transmit the M layers of images;
and transmitting the residual image layers in the target frame image through the residual transmission resources.
Specifically, if a transmission resource corresponding to the (M + 1) th layer image is obtained, the remaining transmission resource is compared with the transmission resource, and when the remaining transmission resource is greater than the transmission resource corresponding to the (M + 1) th layer image, the (M + 1) th layer image is transmitted.
And after the M +1 layer image is transmitted, acquiring the residual transmission resources again, and circularly comparing the residual transmission resources with the transmission resources required by the transmission resources corresponding to the M +2 layer image until the transmission is completed or the residual bandwidth does not accord with the preset condition.
And acquiring the layer number after transmission of the transmission resources is completed, and updating the preset layer number M.
According to the data transmission method provided by the embodiment of the disclosure, a target frame image to be transmitted in a video is layered, the number of layers which can be processed under current transmission resources is determined according to the number of layers which are transmitted in the target frame image and correspond to the last frame image, and the frame layer data which are not transmitted are evenly distributed to the layers of the later target frame image for transmission, so that a progressive transmission strategy of the current video image is realized, the network congestion probability can be reduced on the basis of not influencing human eye senses, and the time delay is reduced.
In an optional embodiment, when the method provided by the present disclosure transmits a target frame image, the method further includes encoding the target frame image, where the encoded data stream structure provided by the present disclosure may include:
basic information of the coded image, such as the length and the bandwidth of the image, the size of the macro block, the frame number, the video format, etc., address information, such as an addressing matrix of a changed macro block (change) between the current frame and the reference frame;
the coding layer number identification matrix is used for indicating the transmitted layer number of each macro block in the data stream transmitted later and storing the data into the corresponding reconstructed frame matrix coordinates during decoding;
and outputting the current frame after Huffman coding.
The data transmission method provided by the embodiment of the disclosure obtains a target frame image and a preset layer corresponding to the target frame image, obtains preset transmission resources required for transmitting the preset layer in the target frame image by layering the target frame image, determines the target layer by a cyclic iteration mode according to the comparison between the preset transmission resources and the current transmission resources, so that a code stream required by the target layer approaches a bandwidth, thereby determining a target layer number matched with the current bandwidth, performs coding transmission on the layer corresponding to the target layer number by the current transmission resources, and transmits the rest of the layer numbers in the next few frames of bandwidth idle periods, thereby achieving the progressive effect that an image is blurred to be clear when a scene is transmitted to change pictures or I frames, evenly distributing instantaneous code streams to multiple frames, and reducing network congestion caused by overlarge code streams.
The video coding and decoding progressive transmission scheme based on bandwidth limitation, which is provided by the disclosure, has little influence on human eye sensory effect while smoothing video transmission code streams, and can be applied to a video coding and decoding transmission system.
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. 2, the data transmission apparatus 20 includes: a receiver 201, a processor 202 and a transmitter 203,
the processor 202 is respectively connected with the receiver 201 and the transmitter 203;
the receiver 201 is configured to obtain a target frame image and a preset number of layers M corresponding to the target frame image, where the target frame image includes N layers, and the preset number of layers M refers to a number of layers of a last frame image corresponding to the target frame image, where the last frame image has been transmitted;
the processor 202 is configured to, when the target frame image includes a changing macro block, obtain a preset transmission resource corresponding to the preset number of layers M according to the preset number of layers M, where the changing 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 in the target frame image according to the comparison result of the preset transmission resource and the target transmission resource;
the transmitter 203 is configured to transmit the layer corresponding to the target layer number in the target frame image.
In one embodiment, the processor 202 in the apparatus is further configured to,
after the transmission of the layer corresponding to the target layer number is finished, acquiring residual transmission resources, wherein the residual transmission resources refer to residual transmission resources after the target transmission resources transmit the layer corresponding to the target layer number;
and transmitting the residual layers in the target frame image layer by layer according to the residual transmission resources, and updating the preset layer number M.
In one embodiment, the processor 202 in the apparatus is further configured to,
when the target frame image is a first frame image in a target video, acquiring target transmission resources and transmission resources corresponding to each layer in the N layers of images;
transmitting each layer of image layer by layer, 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 target frame image is transmitted completely;
and acquiring the transmitted layer number of the target frame image, and setting the layer number as a preset layer number M.
In one embodiment, the processor 202 in the apparatus is further configured to,
when the target frame image does not include the change macro block, obtaining a layer which is not completely transmitted in the previous frame image corresponding to the target frame image;
and transmitting the layers which are not transmitted in the previous frame of image.
In one embodiment, the processor 202 in the apparatus is further configured to,
acquiring the number of layers of a transmitted layer corresponding to each macro block in a previous frame image corresponding to the target frame image;
if the number of layers of the transmitted layers is different, sequentially transmitting each layer of layer which is not transmitted in the previous frame of image layer by layer according to the number of layers of the transmitted layers, acquiring residual transmission resources after each layer of layer is transmitted, and transmitting the next layer of 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 transmission of the previous frame of image is finished.
The data transmission device provided by the embodiment of the disclosure performs layering processing through the target frame image, determines the conversion layer through a cyclic iteration mode, and enables the code stream of the conversion layer to approach the bandwidth, thereby determining the target layer number finally suitable for the current bandwidth, and then performs coding transmission on the corresponding maximum layer number according to the current transmission bandwidth environment, and the rest of the layer numbers are distributed in the idle period of the bandwidth of the next frames for transmission, so that the progressive effect that the image is blurred to be clear when a scene is converted or an I frame is transmitted is achieved, instantaneous code streams are evenly distributed on multiple frames, and the network congestion phenomenon caused by too large code streams is reduced.
Based on the data transmission method described in the embodiment corresponding to fig. 1, an embodiment of the present disclosure further provides a computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a Read Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The storage medium stores computer instructions for executing the data transmission method described in the embodiment corresponding to fig. 1, 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 and a preset layer number M corresponding to the target frame image, wherein the preset layer number M refers to the layer number transmitted by a previous frame image corresponding to the target frame image;
performing layering processing on the target frame image to generate N layers, wherein the performing layering processing on the target frame image to generate the N layers comprises: 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; performing layering processing on the target frame image according to the direct current component and the alternating current component to generate N layers;
when the target frame image comprises a change macro block, acquiring a preset transmission resource corresponding to the preset layer number M according to the preset layer number M, wherein the change 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 preset 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 of claim 1, further comprising:
after the transmission of the layers corresponding to the target layer number is finished, 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 target layer number;
and transmitting the residual layers in the target frame image layer by layer according to the residual transmission resources, and updating the preset layer number M.
3. The method of claim 1, further comprising:
when the target frame image is a first frame image in a target video, acquiring a target transmission resource;
transmitting each layer of the target frame image layer by layer through the target transmission resources, acquiring residual transmission resources after each layer of the image layer is transmitted, and transmitting the next layer of the 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 target frame image is transmitted completely;
and acquiring the number of layers of the target frame image after transmission is finished, and setting the number of layers as a preset number M.
4. The method of claim 1, further comprising:
when the target frame image does not include the change macro block, obtaining a layer which is not transmitted in the previous frame image and corresponds to the target frame image;
and transmitting the layers which are not transmitted in the previous frame of image.
5. The method according to claim 4, wherein said transmitting layers of the previous frame image that are not completely transmitted comprises:
acquiring the number of layers of a transmitted layer corresponding to each macro block in a previous frame image corresponding to the target frame image;
if the number of layers of the transmitted layers is different, sequentially transmitting each layer of layers which are not transmitted in the previous frame of image layer by layer according to the number of layers, acquiring residual transmission resources after each layer of layers is transmitted, and transmitting the next layer of layers 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.
6. 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 configured to obtain a target frame image and a preset number of layers M corresponding to the target frame image, where the preset number of layers M refers to a number of layers of a last frame image corresponding to the target frame image that has been transmitted;
the processor is configured to perform layering processing on the target frame image to generate N layers, and specifically includes: 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; performing layering processing on the target frame image according to the direct current component and the alternating current component to generate N layers;
the processor is configured to, when the target frame image includes a changed macro block, obtain a preset transmission resource corresponding to the preset number of layers M according to the preset number of layers M, where 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 M-th layer in the target frame image;
determining the number of target layers in the target frame image according to the comparison result of the preset 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.
7. The apparatus of claim 6, wherein the processor is further configured to,
after the transmission of the layers corresponding to the target layer number is finished, 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 target layer number;
and transmitting the residual image layers in the target frame image layer by layer according to the residual transmission resources, and updating the preset layer number M.
8. The apparatus of claim 6, wherein the processor is further configured to,
when the target frame image is a first frame image in a target video, acquiring a target transmission resource;
transmitting each layer of the target frame image layer by layer through the target transmission resources, acquiring residual transmission resources after each layer of layer is transmitted, and transmitting the next layer of 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 target frame image is transmitted completely;
and acquiring the number of layers of the transmitted target frame image, and setting the number of layers as a preset number of layers M.
9. The apparatus of claim 6, wherein the processor is further configured to,
when the target frame image does not comprise the change macro block, acquiring an untransmitted layer in a previous frame image corresponding to the target frame image;
and transmitting the layers which are not transmitted in the previous frame of image.
10. The apparatus of claim 9, wherein the processor is further configured to,
acquiring the number of layers of a transmitted layer corresponding to each macro block in a previous frame image corresponding to the target frame image;
if the number of layers of the transmitted layers is different, sequentially transmitting each layer of layer which is not transmitted in the previous frame of image layer by layer according to the number of layers of the transmitted layers, acquiring residual transmission resources after each layer of layer is transmitted, and transmitting the next layer of 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 transmission of the previous frame of image is finished.
CN202010179999.6A 2020-03-16 2020-03-16 Data transmission method and device Active CN111447445B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010179999.6A CN111447445B (en) 2020-03-16 2020-03-16 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010179999.6A CN111447445B (en) 2020-03-16 2020-03-16 Data transmission method and device

Publications (2)

Publication Number Publication Date
CN111447445A CN111447445A (en) 2020-07-24
CN111447445B true CN111447445B (en) 2022-09-09

Family

ID=71654092

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010179999.6A Active CN111447445B (en) 2020-03-16 2020-03-16 Data transmission method and device

Country Status (1)

Country Link
CN (1) CN111447445B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001062010A1 (en) * 2000-02-15 2001-08-23 Microsoft Corporation System and method with advance predicted bit-plane coding for progressive fine-granularity scalable (pfgs) video coding
CN1784003A (en) * 2004-11-29 2006-06-07 索尼株式会社 Content transfer system, communication device, communication method and programme
US7747086B1 (en) * 2005-07-28 2010-06-29 Teradici Corporation Methods and apparatus for encoding a shared drawing memory
CN101917614A (en) * 2010-06-03 2010-12-15 北京邮电大学 Bit rate control method based on H.264 hierarchical B-frame coding structure
CN103237206A (en) * 2013-03-27 2013-08-07 北京奇虎科技有限公司 Display method, processing device and display system for remote images
CN109862365A (en) * 2019-01-30 2019-06-07 西安万像电子科技有限公司 Image processing method and device
CN110365985A (en) * 2019-06-03 2019-10-22 西安万像电子科技有限公司 Image processing method and device
CN110460855A (en) * 2019-07-22 2019-11-15 西安万像电子科技有限公司 Image processing method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9173008B1 (en) * 2014-04-22 2015-10-27 Xerox Corporation Layered video transmission over communication channels

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001062010A1 (en) * 2000-02-15 2001-08-23 Microsoft Corporation System and method with advance predicted bit-plane coding for progressive fine-granularity scalable (pfgs) video coding
CN1784003A (en) * 2004-11-29 2006-06-07 索尼株式会社 Content transfer system, communication device, communication method and programme
US7747086B1 (en) * 2005-07-28 2010-06-29 Teradici Corporation Methods and apparatus for encoding a shared drawing memory
CN101917614A (en) * 2010-06-03 2010-12-15 北京邮电大学 Bit rate control method based on H.264 hierarchical B-frame coding structure
CN103237206A (en) * 2013-03-27 2013-08-07 北京奇虎科技有限公司 Display method, processing device and display system for remote images
CN109862365A (en) * 2019-01-30 2019-06-07 西安万像电子科技有限公司 Image processing method and device
CN110365985A (en) * 2019-06-03 2019-10-22 西安万像电子科技有限公司 Image processing method and device
CN110460855A (en) * 2019-07-22 2019-11-15 西安万像电子科技有限公司 Image processing method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《A new source model and accurate rate control algorithm with QP and rounding offset adaptation》;Qian Xu 等;《2008 15th IEEE International Conference on Image Processing》;20081212;全文 *
《基于H.264标准的渐进量化可分级视频编码算法的研究与实现》;杨杰祥;《万方平台》;20080124;全文 *

Also Published As

Publication number Publication date
CN111447445A (en) 2020-07-24

Similar Documents

Publication Publication Date Title
US9762917B2 (en) Quantization method and apparatus in encoding/decoding
JP5107495B2 (en) Quality-based image compression
CA2295689C (en) Apparatus and method for object based rate control in a coding system
KR101298389B1 (en) Method and system for video coder and decoder joint optimization
US7697783B2 (en) Coding device, coding method, decoding device, decoding method, and programs of same
US10616594B2 (en) Picture encoding device and picture encoding method
WO1999004359A1 (en) Apparatus and method for macroblock based rate control in a coding system
CN111556315A (en) Data transmission method and device
JP3703299B2 (en) Video coding method, system and computer program product for optimizing picture center image quality
WO2019104862A1 (en) System and method for reducing video coding fluctuation
JP2017224965A (en) Image coding device and control method
US20050141616A1 (en) Video encoding and decoding methods and apparatuses using mesh-based motion compensation
US7613351B2 (en) Video decoder with deblocker within decoding loop
EP1720356A1 (en) A frequency selective video compression
CN111447445B (en) Data transmission method and device
KR101086724B1 (en) ?? Deciding Method of H.264/AVC Encoder using Complexity of Frame, and H.264/AVC Encoder implementing the same
JPH07203430A (en) Image coding device
JP3902948B2 (en) Video encoding device
JP4942208B2 (en) Encoder
CN112422964B (en) Progressive coding method and device
JP3779066B2 (en) Video encoding device
CN112312136B (en) Code stream control method and device
KR0166723B1 (en) The quantization level adjustment method with an image characterization
Paek et al. Rate control strategy based on human visual sensitivity for MPEG video coder
JPH07184195A (en) Picture coder

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
GR01 Patent grant
GR01 Patent grant