CN113542740B - Image transmission method and device - Google Patents
Image transmission method and device Download PDFInfo
- Publication number
- CN113542740B CN113542740B CN202110626442.7A CN202110626442A CN113542740B CN 113542740 B CN113542740 B CN 113542740B CN 202110626442 A CN202110626442 A CN 202110626442A CN 113542740 B CN113542740 B CN 113542740B
- Authority
- CN
- China
- Prior art keywords
- macro block
- state table
- target
- data
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/17—Methods 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/176—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/119—Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods 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/146—Data rate or code amount at the encoder output
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods 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/157—Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The embodiment of the disclosure provides an image transmission method and an image transmission device, relates to the technical field of image transmission, and can solve the problem that transmission pressure is too high due to too large code stream when escape colors are too much. The specific technical scheme is as follows: judging whether the image frame is an I frame; when the image frame is not an I frame, determining whether the data of a target macro block changes according to a macro block state table, wherein the macro block state table is used for representing whether the data of macro blocks at the same position among different frames change; when the data of the target macro block is not changed, identifying the type of the target macro block; when the target macro block is a text macro block, quantizing the escape color of the target macro block into M-bit numerical values under an X-system; selecting Q digit numerical code transmission according to the progressive transmission state table and a preset rule and updating the progressive transmission state table, wherein Q is less than or equal to M; the progressive transmission state table is used for representing the transmitted number of bits in the M-bit value.
Description
The application is a divisional application of a Chinese patent with an application number of 201910481634.6 and an application name of "image transmission method and device" filed by the Chinese patent office on 2019, 6, month and 4.
Technical Field
The present disclosure relates to the field of image transmission technologies, and in particular, to an image transmission method and apparatus.
Background
With the rapid development of internet technology, the digital information age has deepened into various aspects of people's lives, and the networked transmission of images and videos is becoming more and more popular in internet applications, such as interactive screen image transmission in scenes such as remote desktops, video conferences, and the like.
At present, the color index coding algorithm is widely applied to interactive screen image coding transmission, and the basic idea is as follows: selecting several gray values with the largest occurrence frequency in an image as a basic color (base color), quantizing the difference value of the other gray values and the gray value corresponding to the basic color into the basic color in a quantitative interval, using the other gray values with the difference value not in the quantitative interval as escape colors (escape colors), assigning index values for the basic color and the escape colors, replacing each pixel value of an original image with the corresponding index value to form an index map, and finally generating a code stream for the basic color, the escape colors and the index map through coding.
However, when most of Macro Blocks (MBs) in a frame of image are of a type in which many characters are embedded on a picture, when the image is encoded, since many pixels are determined as escape colors, a code stream obtained by final encoding is large, thereby placing a great deal of pressure on transmission.
Disclosure of Invention
The embodiment of the disclosure provides an image transmission method and an image transmission device, which can solve the problem that transmission pressure is too high due to too large code stream when escape colors are too much. The technical scheme is as follows:
according to a first aspect of an embodiment of the present disclosure, there is provided an image transmission method, including:
when the current image frame is an I frame, identifying the type of a target macro block in the image frame; the types include: text macro blocks, picture macro blocks;
when the target macro block is a text macro block, encoding and transmitting data of the target macro block except for the escape color; data other than escape colors include: the system comprises a basic color, an index map, an index value and a macro block state table, wherein the macro block state table is used for representing whether data of macro blocks at the same position among different frames are changed.
In one embodiment, the method further comprises, before:
and judging whether the image frame is an I frame or not.
In one embodiment, the method further comprises:
when the image frame is not an I frame, determining whether the data of a target macro block is changed or not according to a macro block state table;
when the data of the target macro block is not changed, identifying the type of the target macro block;
when the target macro block is a text macro block, quantizing the escape color of the target macro block into M-bit numerical values under an X-system;
selecting Q digit numerical code transmission according to the progressive transmission state table and a preset rule and updating the progressive transmission state table, wherein Q is less than or equal to M; the progressive transmission state table is used for representing the transmitted number of bits in the M-bit value.
A large amount of data of escape colors required to be coded in the I frame is placed in the non-I frame behind the I frame for progressive batch coding transmission, and the coded data volume of the non-I frame is much smaller than that of the I frame, so that the I frame does not need to code a large code stream and the advantage of small non-I frame code stream is effectively utilized due to ingenious arrangement.
In one embodiment, the method further comprises:
when the data of the target macro block changes, updating the macro block state table and identifying the type of the target macro block;
when the target macro block is a text macro block, quantizing the escape color of the target macro block into M-bit numerical values under an X-system;
and selecting a Q bit value (Q is less than or equal to M) according to the progressive transmission state table and a preset rule, updating the progressive transmission state table, and then coding and transmitting the value together with the basic color, the index map and the index value of the target macro block.
When the data of the macro block of the non-I frame at the same position as that of the adjacent frame is changed and the macro block is a text macro block, the data of the basic color, the index map, the index value and part of the escape color of the macro block can be transmitted in the non-I frame.
In one embodiment, selecting the Q-bit value according to the gradual transmission status table and a predetermined rule includes:
determining P bits which are not transmitted in the M bit numerical values according to the progressive transmission state table, wherein P is more than or equal to Q and less than or equal to M;
and selecting Q bit values from the P bits which are not transmitted according to the sequence from the high bits to the low bits in the X system.
In one embodiment, quantizing the escape color of the target macroblock to M-bit values under X, includes:
when X takes 2, according to the quantization parameter 2 i For gray value/2 i Quantizing the escape color into M =2 under binary system after rounding 8-i A bit value, wherein i is a positive integer less than 8.
According to a second aspect of the embodiments of the present disclosure, there is provided an image transmission apparatus including:
the identification module is used for identifying the type of a target macro block in the image frame when the current image frame is an I frame; the types include: text macro blocks, picture macro blocks;
the transmission module is used for coding and transmitting data of the target macro block except for the escape color when the target macro block is a text macro block; data other than escape colors include: the system comprises a basic color, an index map, an index value and a macro block state table, wherein the macro block state table is used for representing whether data of macro blocks at the same position among different frames are changed.
In one embodiment, the apparatus further comprises:
and the judging module is used for judging whether the image frame is an I frame.
In one embodiment, the apparatus further comprises:
the determining module is used for determining whether the data of the target macro block changes according to the macro block state table when the image frame is not an I frame;
the identification module is also used for identifying the type of the target macro block when the data of the target macro block is not changed;
the quantization module is used for quantizing the escape color of the target macro block into an M-bit numerical value under an X-system when the target macro block is a text macro block;
the transmission module is also used for selecting Q digit numerical value coding transmission according to the progressive transmission state table and a preset rule and updating the progressive transmission state table, wherein Q is less than or equal to M; the progressive transmission state table is used for representing the transmitted number of bits in the M-bit value.
A large amount of data of escape colors required to be coded in the I frame is placed in the non-I frame behind the I frame for progressive batch coding transmission, and the coded data volume of the non-I frame is much smaller than that of the I frame, so that the I frame does not need to code a large code stream and the benefit of small code stream of the non-I frame is effectively utilized due to ingenious arrangement.
In one embodiment, the apparatus further comprises:
the updating module is used for updating the macro block state table and calling the identification module to identify the type of the target macro block when the data of the target macro block changes;
the quantization module is also used for quantizing the escape color of the target macro block into an M-bit numerical value under an X-system when the target macro block is a text macro block;
and the transmission module is also used for selecting a Q bit value (Q is less than or equal to M) according to the progressive transmission state table and a preset rule, updating the progressive transmission state table, and then carrying out coding transmission together with the basic color, the index map and the index value of the target macro block.
When the data of the macro block of the non-I frame at the same position as that of the adjacent frame is changed and the macro block is a text macro block, the data of the basic color, the index map, the index value and part of the escape color of the macro block can be transmitted in the non-I frame.
In one embodiment, the transmission module is specifically configured to:
determining P bits which are not transmitted in the M bit numerical values according to the progressive transmission state table, wherein P is more than or equal to Q and less than or equal to M;
and selecting Q bit values from the P bits which are not transmitted according to the sequence from high bits to low bits in the X system, updating the progressive transmission state table and then coding and transmitting.
In one embodiment, the quantization module is specifically configured to:
when X takes 2, according to the quantization parameter 2 i For gray value/2 i Quantizing the escape color into M =2 under binary system after rounding 8-i A bit value, wherein i is a positive integer less than 8.
According to the image transmission method and the image transmission device provided by the embodiment of the disclosure, when a current image frame is an I frame, the type of a target macro block in the image frame is identified; the types include: text macro blocks, picture macro blocks; when the target macro block is a text macro block, encoding and transmitting data of the target macro block except for the escape color; data other than escape colors include: the system comprises a basic color, an index map, an index value and a macro block state table, wherein the macro block state table is used for representing whether data of macro blocks at the same position among different frames are changed. When the I frame is coded, only data except the escape color is coded, so that the problem that the transmission pressure is too high due to too large code stream when the escape color is too much is solved.
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 an architectural diagram of an embodiment of the present disclosure;
fig. 2 is a first flowchart of an image transmission method provided in an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a second image transmission method according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an image transmission apparatus according to an embodiment of the present disclosure.
Fig. 5 is a schematic structural diagram of an image transmission apparatus according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same 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.
As shown in fig. 1, an architecture diagram of a video compression transmission system is shown, in video coding, a coded image is usually divided into a plurality of macro blocks, and a video coding algorithm is used to code macro blocks by macro blocks, organize the macro blocks into a continuous video code stream, and transmit the video code stream. The encoder and the decoder are matched with each other, and the process of decoding the video by the video decoding algorithm can be understood as the data inverse process of the video coding algorithm.
The basic color, the escape color, the index map, and the index value related to the embodiment of the present disclosure are first described in detail below, so that the technical solutions of the embodiments of the present disclosure described later can be understood conveniently.
The types of the macro blocks in the embodiment of the disclosure at least include two types, namely a text macro block and a picture macro block, the text macro block indicates that the image content of the macro block is mainly characters, the picture macro block indicates that the image content of the macro block does not include characters, whether the macro block is a text macro block or a picture macro block can be identified according to an identification algorithm, the identification algorithm can be understood by referring to the existing relevant identification algorithm, and detailed description is not given in the embodiment of the disclosure. In the embodiment of the present disclosure, it is assumed that an image frame may be divided into several macro blocks according to a macro block size of 16 × 16 (a unit is a pixel) (16 × 16 is only a preferred dividing manner, and the embodiment of the present disclosure is not limited thereto, and the dividing manner such as 8*8 or 4*4 is also allowed), and a target macro block in the embodiment of the present disclosure may be understood as any macro block to be encoded after the image frame is divided, and for the target macro block, it is identified as a text macro block or a picture macro block according to an identification policy before encoding processing.
In the embodiment of the present disclosure, for a text macroblock, the process of determining a basic color, an escape color, an index map, and an index value is as follows:
YUV color coding is commonly used in video coding, where Y represents brightness (Luminance), and U and V represent Chroma (Chroma) and saturation (Chroma), respectively.
Step 1, histogram statistics is respectively carried out on the numerical values of YUV components of the video image of the text macro block (16 × 16), wherein the horizontal axis of the histogram is the numerical value of the components, and the vertical axis of the histogram is the frequency of occurrence of the numerical values.
And 2, respectively finding basic color and escape color for the YUV component of each macro block, obtaining a marking table with the size of 16x16 for each YUV component, and then jointly representing the 3 marking tables as a new marking table.
Specifically, taking the Y component as an example, the value range [0,255 ] of the Y component is taken as a value range]Averaging into windows with the length of N (the value of N is a power of 2 and does not exceed 256, and the typical value N = 8), calculating the cumulative sum of histogram frequencies in each window, finding out 4 maximum cumulative sums and the maximum values in corresponding cumulative sum intervals, and sequentially corresponding to 4 basic colors 0,1,2,3 under the Y component and the component numerical values of the basic colors according to the sequence of the 4 cumulative sums from large to small; for the Y component of each pixel in the macroblock, sequentially comparing with the component values of the aforementioned 0,1,2,3 four basic colors, if the absolute value of the difference is within a certain range (N =8 can be 4, and this range determines the ratio of the basic color to the escape color), quantizing the pixel into the basic color value, filling a mark table corresponding to the Y component (the filling mark value is 0,1,2, or 3), if none of the difference is satisfied, indicating the escape color, quantizing by a quality parameter (the general strategy is the escape color value/quality parameter), filling the mark table corresponding to the Y component, and filling the mark value into 4; (3) and (3) performing combined representation of a 5-system (reason: the mark value in the mark table is 0,1,2,3 or 4) on the 3 mark tables of the YUV three components, and calculating to obtain the mark value of each pixel in 1 new mark table: 5 2 * Y component flag value +5 1 * U component flag value +5 0 * The V component marks the value. It should be noted that, for the mark value of each pixel in the new mark table, the specific mark values of the Y component, the U component, and the V component of each pixel may be reversely derived according to the joint expression formula and the limiting condition that the mark values of the Y component, the U component, and the V component take values of 0,1,2,3, or 4.
Then, the label value of the current pixel is compared (can be set) with the label values of the adjacent left and upper pixels according to the new label table to obtain the LUO table. Specifically, L indicates that the current pixel has the same label value as the left adjacent pixel, and is relabeled to 0; u represents that the basic color value of the current pixel is the same as that of the pixel directly above the current pixel, and the pixel is marked as 1 again; o indicates that the current pixel is not the same as the above and left pixel marker values, and is relabeled as 2. It should be noted that, in a special case, when there is a pixel on both left and top of the current pixel, the current pixel is compared with the left adjacent pixel first, and if the current pixel is the same as the left adjacent pixel, the current pixel is directly marked as 0, and if the current pixel is different from the top adjacent pixel, the current pixel is compared with the top adjacent pixel, the current pixel is marked as 1, and if the current pixel is different from the top adjacent pixel, the current pixel is not marked as 2. In the case of O, since the value of itself cannot be obtained from the neighborhood, the label value obtained in step 2 for this pixel needs to be recorded. It should be noted that, for the LUO table, according to the generation rule of the LUO table, as long as there is a label value of each pixel in the label values corresponding to O, the label value of each pixel can be reversely derived.
And 3, further processing the LUO table to determine an index map and an index value.
Specifically, when all rows in the LUO table (16 × 16) are of the L type, they are again relabeled as 81; when a row is all of the U type, it is again relabeled as 82; when a row is all of the O type, it is again relabeled as 83; otherwise, joint representation of 3-system (reason: the values of the marks in the LUO table are 0,1 and 2) can be performed according to a group of 4 elements from left to right: index value =3 for index map 3 * First LUO flag value +3 2 * Second LUO flag +3 1 * Third LUO flag +3 0 * The fourth LUO flag.
It is worth mentioning that the LUO table can be reversely deduced according to the generation rule of the index map and the index value in the index map; furthermore, the mark value of each pixel can be reversely deduced, and further, the specific mark values of the Y component, the U component and the V component of each pixel can be reversely deduced; and finally, by combining the component values of the basic colors of the Y component, the U component and the V component, the specific component values of the Y component, the U component and the V component of each pixel can be finally reversely deduced. The above-mentioned inverse push processing may be performed by the video decoding side.
An embodiment of the present disclosure provides an image transmission method, as shown in fig. 2, fig. 2 is a flowchart of the image transmission method provided in the embodiment of the present disclosure, and the image transmission method includes the following steps:
101. when the current image frame is an I frame, the type of the target macro block in the image frame is identified.
In one embodiment, as shown in fig. 3, the method further comprises, before:
100. and judging whether the image frame is an I frame.
Specifically, the existing determination algorithm can be referred to for determining whether the image frame is an I frame, and details thereof are not described herein. When the image frame is judged to be an I frame, executing the step 101 and the corresponding steps; when the image frame is determined not to be an I frame, step 103 and the corresponding steps are executed.
102. When the target macro block is a text macro block, encoding and transmitting data of the target macro block except for the escape color; data other than escape colors include: the system comprises a basic color, an index map, an index value and a macro block state table, wherein the macro block state table is used for representing whether data of macro blocks at the same position among different frames are changed.
Specifically, the basic color, the index map and the index value refer to the description in the foregoing related paragraphs, and for the macroblock status table, status data of all macroblocks in an image frame may be stored in the table, for example, data of a macroblock in the same position in two previous and next image frames may be represented by 1, and 0 represents no change. The macro block state table is updated in real time and can be maintained at the encoding end and the decoding end simultaneously, the macro block state table is needed when the encoding end encodes macro block data, and the macro block state table is needed when the decoding end decodes data.
It should be noted that, as can be seen from step 102, when encoding an I frame, only data other than the escape color is encoded, so that the problem that the transmission pressure is too high due to too large code stream when the escape color is too much can be avoided.
In one embodiment, as shown in fig. 3, the method may further include:
103. when the image frame is not an I frame, determining whether the data of a target macro block changes according to a macro block state table;
specifically, whether data change occurs between a target macro block in the image frame and a macro block corresponding to the target macro block in the previous image frame is determined according to the macro block state table. For example, in a video conference or a scene presented by a PPT lecture or a document, the picture content does not change for a certain time, and therefore, the data of a large number of macro blocks of an image frame does not change.
104. When the data of the target macro block is not changed, the type of the target macro block is identified.
Specifically, when the data of the target macroblock is unchanged compared with the data of the macroblock corresponding to the target macroblock in the previous image frame, similar to step 101, whether the target macroblock is a text macroblock or a picture macroblock is identified according to the identification policy.
105. And when the target macro block is a text macro block, quantizing the escape color of the target macro block into M-bit numerical values under an X-system.
In one embodiment, quantizing the escape color of the target macroblock into an M-bit value under an X-ary system, specifically including:
when X takes 2, according to the quantization parameter 2 i For gray value/2 i Quantizing the escape color into M =2 under binary system after rounding 8-i A bit value, wherein i is a positive integer less than 8.
For example, assuming that X is 2, X is binary, and the escape color of the target macroblock is set to [0,255 [ ]]In range) by the parameter 16 (2) i I = 4) to [0,15]It was converted to 4 bits (M = 2) 8-i A binary value represented by = 4). The escape color (value is [0,255 ] is given by parameter 16]In-range) to [0,15]The following processes are exemplified: the value is [0,15]The escape color in the range is quantified as 0 and takes the value of [16,31]The escape color in the range is quantified as 1 and takes the value of [32,47]The escape color quantization in the range of 2, …, is taken as [240,255]The escape color quantification in the range is 15.
106. Selecting Q digit numerical code transmission according to the progressive transmission state table and a preset rule and updating the progressive transmission state table, wherein Q is less than or equal to M; the progressive transmission state table is used for representing the transmitted number of bits in the M-bit value.
In one embodiment, selecting the Q-bit value according to the gradual transmission state table and a preset rule specifically includes:
1061. determining P bits which are not transmitted in the M bit numerical values according to the progressive transmission state table, wherein P is more than or equal to Q and less than or equal to M;
1062. and selecting Q bit values from the P bits which are not transmitted according to the sequence from the high bits to the low bits in the X system.
Illustratively, the escape color is quantized into a 4 (M = 4) bit value in the binary system, progressive transmission is started, transmission is performed in the order from the highest bit to the lowest bit in the binary system, and if the transmitted bit number is determined to be 0 according to the progressive transmission state table (P = 4-0=4), the value of the highest bit (Q = 1) may be selected for encoding transmission when data of the current image frame is encoded, and meanwhile, the progressive transmission state table is also updated so that the transmitted bit number is known when the escape color is encoded and transmitted in the next image frame, and thus the bit number that is not transmitted is selected for continuing encoding and transmission, and if the one-bit value is set according to the transmission color of the previous image frame, four image frames may be completely transmitted.
Through the steps, the non-I frame after a large amount of data of escape colors needing to be coded in the I frame is placed in the I frame is subjected to progressive batch coding transmission, and the coded data volume of the non-I frame is much smaller than that of the I frame, so that the I frame does not need to code a large code stream and the benefit of small non-I frame code stream is effectively utilized due to ingenious arrangement.
In one embodiment, as shown in fig. 3, the method may further include:
107. when the data of the target macro block is changed, the macro block state table is updated and the type of the target macro block is identified.
Specifically, when the data of the target macroblock is changed compared with the data of the macroblock in the previous image frame corresponding to the target macroblock, the macroblock status table is updated, and similarly to step 101, whether the target macroblock is a text macroblock or a picture macroblock is identified according to the identification policy.
108. And when the target macro block is a text macro block, quantizing the escape color of the target macro block into M-bit numerical values under an X-system.
Specifically, reference is made to the expression of step 105.
109. And selecting a Q bit value (Q is less than or equal to M) according to the progressive transmission state table and a preset rule, updating the progressive transmission state table, and coding and transmitting the value together with the basic color, the index map and the index value of the target macro block.
Specifically, the description of step 106 and the related descriptions of the basic color, the index map, and the index value are referred to.
When the data of the macro block of the non-I frame at the same position as the adjacent frame is changed and the macro block is a text macro block, the data of the basic color, the index map, the index value and part of the escape color of the macro block can be transmitted in the non-I frame, because the coded data amount of the non-I frame is much smaller than that of the I frame, the bandwidth can be effectively utilized, and in addition, the mode (step 106) of transmitting the escape color by progressive batch coding is kept consistent with that of other frames, the fluctuation of the picture output quality is not large, and the user experience is good.
According to the image transmission method provided by the embodiment of the disclosure, when a current image frame is an I frame, the type of a target macro block in the image frame is identified; the types include: text macro blocks, picture macro blocks; when the target macro block is a text macro block, encoding and transmitting data of the target macro block except for the escape color; data other than escape colors include: the system comprises a basic color, an index map, an index value and a macro block state table, wherein the macro block state table is used for representing whether data of macro blocks at the same position among different frames are changed. When the I frame is coded, only data except the escape color is coded, so that the problem that the transmission pressure is too high due to too large code stream when the escape color is too much is solved.
Based on the image transmission method described in the embodiment corresponding to fig. 2 or fig. 3, the following is an embodiment of the apparatus of the present disclosure, which can be used to execute the embodiment of the method of the present disclosure.
The embodiment of the present disclosure provides an image transmission apparatus, as shown in fig. 4, the image transmission apparatus 40 includes:
the identifying module 401 is configured to identify a type of a target macro block in a current image frame when the current image frame is an I frame; the types include: text macro blocks, picture macro blocks;
a transmission module 402, configured to, when the target macroblock is a text macroblock, encode and transmit data of the target macroblock except for the escape color; data other than escape colors include: the system comprises a basic color, an index map, an index value and a macro block state table, wherein the macro block state table is used for representing whether data of macro blocks at the same position among different frames are changed.
In one embodiment, as shown in fig. 5, the apparatus 40 further comprises:
the determining module 400 is configured to determine whether the image frame is an I frame.
In one embodiment, as shown in fig. 5, the apparatus 40 further comprises:
a determining module 403, configured to determine whether data of a target macroblock changes according to a macroblock status table when the image frame is not an I frame;
the identifying module 401 is further configured to identify a type of the target macroblock when the data of the target macroblock is unchanged;
a quantization module 404, configured to quantize the escape color of the target macroblock into an M-bit value under an X-system when the target macroblock is a text macroblock;
the transmission module 402 is further configured to select a Q-bit numerical value code for transmission and update the progressive transmission state table according to the progressive transmission state table and a preset rule, where Q is equal to or less than M; the progressive transmission state table is used for representing the transmitted number of bits in the M-bit value.
A large amount of data of escape colors required to be coded in the I frame is placed in the non-I frame behind the I frame for progressive batch coding transmission, and the coded data volume of the non-I frame is much smaller than that of the I frame, so that the I frame does not need to code a large code stream and the advantage of small non-I frame code stream is effectively utilized due to ingenious arrangement.
In one embodiment, as shown in fig. 5, the apparatus 40 further comprises:
an updating module 405, configured to update the macroblock status table and invoke the identifying module 401 to identify the type of the target macroblock when the data of the target macroblock changes;
the quantization module 404 is further configured to quantize the escape color of the target macroblock into an M-bit numerical value under an X-ary when the target macroblock is a text macroblock;
the transmission module 402 is further configured to select a Q-bit value (Q is less than or equal to M) according to the progressive transmission state table and a preset rule, update the progressive transmission state table, and perform encoding transmission together with the basic color, the index map, and the index value of the target macroblock.
When the data of the macro block of the non-I frame at the same position as that of the adjacent frame is changed and the macro block is a text macro block, the data of the basic color, the index map, the index value and part of the escape color of the macro block can be transmitted in the non-I frame.
In one embodiment, the transmission module 402 is specifically configured to:
determining P bits which are not transmitted in the M bit numerical values according to the progressive transmission state table, wherein P is more than or equal to Q and less than or equal to M;
and selecting Q bit values from the P bits which are not transmitted according to the sequence from high bits to low bits in the X system, updating the progressive transmission state table and then coding and transmitting.
In one embodiment, the quantization module 404 is specifically configured to:
when X takes 2, according to the quantization parameter 2 i For gray value/2 i Quantizing the escape color into M =2 under binary system after rounding 8-i A bit value, wherein i is a positive integer less than 8.
According to the image transmission device provided by the embodiment of the disclosure, when a current image frame is an I frame, the type of a target macro block in the image frame is identified; the types include: text macro blocks, picture macro blocks; when the target macro block is a text macro block, encoding and transmitting data of the target macro block except for the escape color; data other than escape colors include: the system comprises a basic color, an index map, an index value and a macro block state table, wherein the macro block state table is used for representing whether data of macro blocks at the same position among different frames are changed. When the I frame is coded, only data except the escape color is coded, so that the problem that the transmission pressure is too high due to too large code stream when the escape color is too much is solved.
Based on the image 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 image 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 (6)
1. An image transmission method, characterized in that the method comprises:
judging whether the image frame is an I frame;
when the image frame is not an I frame, determining whether the data of a target macro block changes according to a macro block state table, wherein the macro block state table is used for representing whether the data of macro blocks at the same position among different frames change;
when the data of the target macro block is not changed, identifying the type of the target macro block;
when the target macro block is a text macro block, quantifying the escape color of the target macro block into an M-bit numerical value under an X-system;
selecting Q digit numerical code transmission according to a progressive transmission state table and a preset rule and updating the progressive transmission state table, wherein Q is less than or equal to M; the progressive transmission state table is used for representing the transmitted bit number in the M bit numerical value;
the method further comprises the following steps:
when the image frame is an I frame, if the target macro block is a text macro block, encoding and transmitting data of the target macro block except for escape color; wherein the data other than the escape color includes: basic color, index map, index value and macro block state table.
2. The method of claim 1, further comprising:
when the data of the target macro block changes, updating the macro block state table and identifying the type of the target macro block;
when the target macro block is a text macro block, quantifying the escape color of the target macro block into an M-bit numerical value under an X-system;
and selecting a Q bit value (Q is less than or equal to M) according to a progressive transmission state table and a preset rule, updating the progressive transmission state table, and coding and transmitting the value together with the basic color, the index map and the index value of the target macro block.
3. The method of claim 1, wherein selecting the Q bit value according to the gradual transmission status table and a predetermined rule comprises:
determining P bits which are not transmitted in the M bit numerical values according to the progressive transmission state table, wherein P is more than or equal to Q and less than or equal to M;
and selecting Q bit values from the P bits which are not transmitted according to the sequence from high bits to low bits in the X system.
4. An image transmission apparatus, characterized in that the apparatus comprises:
the judging module is used for judging whether the image frame is an I frame;
the determining module is used for determining whether the data of a target macro block changes according to a macro block state table when the image frame is not an I frame, wherein the macro block state table is used for representing whether the data of macro blocks at the same position among different frames change;
the identification module is used for identifying the type of the target macro block when the data of the target macro block is not changed;
the quantization module is used for quantizing the escape color of the target macro block into an M-bit numerical value under an X-system when the target macro block is a text macro block;
the transmission module is used for selecting Q digit numerical value coding transmission according to the progressive transmission state table and a preset rule and updating the progressive transmission state table, wherein Q is less than or equal to M; the progressive transmission state table is used for representing the transmitted bit number in the M bit numerical value;
the apparatus is further configured to:
when the image frame is an I frame, if the target macro block is a text macro block, encoding and transmitting data of the target macro block except for escape color; wherein the data other than the escape color includes: basic color, index map, index value and macro block state table.
5. The apparatus of claim 4, further comprising:
the updating module is used for updating the macro block state table and calling the identification module to identify the type of the target macro block when the data of the target macro block changes;
the quantization module is further configured to quantize the escape color of the target macroblock into an M-bit numerical value under an X-ary system when the target macroblock is a text macroblock;
and the transmission module is also used for selecting a Q bit value (Q is less than or equal to M) according to the progressive transmission state table and a preset rule, updating the progressive transmission state table, and then coding and transmitting the value together with the basic color, the index map and the index value of the target macro block.
6. The apparatus of claim 4, wherein the transmission module is specifically configured to:
determining P bits which are not transmitted in the M bit numerical values according to the progressive transmission state table, wherein P is more than or equal to Q and less than or equal to M;
and selecting Q bit values from the P bits which are not transmitted according to the sequence from high bits to low bits in the X system, updating the progressive transmission state table and then coding and transmitting.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110626442.7A CN113542740B (en) | 2019-06-04 | 2019-06-04 | Image transmission method and device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910481634.6A CN110401833B (en) | 2019-06-04 | 2019-06-04 | Image transmission method and device |
CN202110626442.7A CN113542740B (en) | 2019-06-04 | 2019-06-04 | Image transmission method and device |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910481634.6A Division CN110401833B (en) | 2019-06-04 | 2019-06-04 | Image transmission method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113542740A CN113542740A (en) | 2021-10-22 |
CN113542740B true CN113542740B (en) | 2023-01-13 |
Family
ID=68323128
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110626442.7A Active CN113542740B (en) | 2019-06-04 | 2019-06-04 | Image transmission method and device |
CN201910481634.6A Active CN110401833B (en) | 2019-06-04 | 2019-06-04 | Image transmission method and device |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910481634.6A Active CN110401833B (en) | 2019-06-04 | 2019-06-04 | Image transmission method and device |
Country Status (2)
Country | Link |
---|---|
CN (2) | CN113542740B (en) |
WO (1) | WO2020244324A1 (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113542740B (en) * | 2019-06-04 | 2023-01-13 | 西安万像电子科技有限公司 | Image transmission method and device |
CN111277829B (en) * | 2020-02-25 | 2023-03-24 | 西安万像电子科技有限公司 | Encoding and decoding method and device |
CN111447452B (en) * | 2020-03-30 | 2024-07-23 | 西安万像电子科技有限公司 | Data coding method and system |
CN111563517B (en) * | 2020-04-20 | 2023-07-04 | 腾讯科技(深圳)有限公司 | Image processing method, device, electronic equipment and storage medium |
CN112422964B (en) * | 2020-10-30 | 2024-05-17 | 西安万像电子科技有限公司 | Progressive coding method and device |
CN112929669B (en) * | 2021-01-21 | 2022-12-06 | 重庆京像微电子有限公司 | Image encoding and decoding method and device |
CN116668701A (en) * | 2023-05-18 | 2023-08-29 | 联通沃音乐文化有限公司 | Transmission method applied to interactive screen sharing |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105472392A (en) * | 2015-12-11 | 2016-04-06 | 钟炎培 | Screen video encoding and decoding method based on progressive character block compression and encoding and decoding device |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9699468B2 (en) * | 2014-02-10 | 2017-07-04 | Microsoft Technology Licensing, Llc | Adaptive screen and video coding scheme |
CN106797468B (en) * | 2014-10-06 | 2018-10-30 | 华为技术有限公司 | Efficient video coding (HEVC) screen content encodes improved pallet mode in (SCC) |
US10097837B2 (en) * | 2014-10-10 | 2018-10-09 | Qualcomm Incorporated | Palette run hiding in palette-based video coding |
WO2016123262A1 (en) * | 2015-01-29 | 2016-08-04 | Vid Scale, Inc. | Escape color coding for palette coding mode |
KR101552509B1 (en) * | 2015-05-07 | 2015-09-22 | 주식회사 탑코믹스 | System for multi language support for a Webtoon |
CN107770539A (en) * | 2017-10-13 | 2018-03-06 | 西安万像电子科技有限公司 | The coding method of character block and device and its coding/decoding method and device |
CN108881913B (en) * | 2018-08-03 | 2020-09-22 | 西安万像电子科技有限公司 | Method and apparatus for image encoding |
CN113542740B (en) * | 2019-06-04 | 2023-01-13 | 西安万像电子科技有限公司 | Image transmission method and device |
-
2019
- 2019-06-04 CN CN202110626442.7A patent/CN113542740B/en active Active
- 2019-06-04 CN CN201910481634.6A patent/CN110401833B/en active Active
-
2020
- 2020-04-23 WO PCT/CN2020/086281 patent/WO2020244324A1/en active Application Filing
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105472392A (en) * | 2015-12-11 | 2016-04-06 | 钟炎培 | Screen video encoding and decoding method based on progressive character block compression and encoding and decoding device |
Non-Patent Citations (1)
Title |
---|
基于宏块类型的检错方法;方勇等;《中国科学(E辑:信息科学)》;20080415(第04期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110401833B (en) | 2021-06-04 |
CN113542740A (en) | 2021-10-22 |
CN110401833A (en) | 2019-11-01 |
WO2020244324A1 (en) | 2020-12-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113542740B (en) | Image transmission method and device | |
CN1620761B (en) | Adaptive variable length coding and decoding method, and corresponding encoder and decoder | |
CN1332563C (en) | Coding method of video frequency image jump over macro block | |
US7903873B2 (en) | Textual image coding | |
CN101584218B (en) | Method and apparatus for encoding and decoding based on intra prediction | |
US7630512B2 (en) | Method for performing recoverable video and image watermarking which survives block-based video and image compression | |
CN109640089B (en) | Image coding and decoding method and device | |
JP2012170122A (en) | Method for encoding image, and image coder | |
CN104969549A (en) | Mixed mode for frame buffer compression | |
CN108271024A (en) | Image coding, coding/decoding method and device | |
CN105323583A (en) | Encoding method, decoding method, encoding/decoding system, encoder and decoder | |
CN110149515B (en) | Data transmission method and device | |
US20160029030A1 (en) | Transmitting and receiving a composite image | |
US8630500B2 (en) | Method for the encoding by segmentation of a picture | |
CN111447452B (en) | Data coding method and system | |
CN108391132B (en) | Character block coding method and device | |
CN110996127B (en) | Image encoding and decoding method, device and system | |
US20160073124A1 (en) | Transmitting and receiving a composite image | |
CN104902281B (en) | A kind of information concealing method of the HEVC videos based on Hamming code+1 | |
CN100546390C (en) | In picture coding course, realize the method for adaptive scanning | |
CN115474044B (en) | Bayer domain image lossy compression method | |
CN116320446A (en) | Video encoding method and device, electronic equipment and computer medium | |
CN107222743B (en) | Image processing method, device and system | |
CN113301339A (en) | Data encoding and decoding method and device | |
CN104918050A (en) | Image compression method of reference pixel sample value set using dynamic arrangement recombination |
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 |