CN108632612B - Method and apparatus for code compression - Google Patents

Method and apparatus for code compression Download PDF

Info

Publication number
CN108632612B
CN108632612B CN201810502817.7A CN201810502817A CN108632612B CN 108632612 B CN108632612 B CN 108632612B CN 201810502817 A CN201810502817 A CN 201810502817A CN 108632612 B CN108632612 B CN 108632612B
Authority
CN
China
Prior art keywords
interval
code stream
quantization step
value
quantization
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
CN201810502817.7A
Other languages
Chinese (zh)
Other versions
CN108632612A (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.)
Shanghai Jingxiang Microelectronics Co.,Ltd.
Original Assignee
Shanghai Jingxiang Microelectronics 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 Shanghai Jingxiang Microelectronics Co ltd filed Critical Shanghai Jingxiang Microelectronics Co ltd
Priority to CN201810502817.7A priority Critical patent/CN108632612B/en
Publication of CN108632612A publication Critical patent/CN108632612A/en
Application granted granted Critical
Publication of CN108632612B publication Critical patent/CN108632612B/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/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/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/182Methods 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 a pixel
    • 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/186Methods 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 a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/30Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation

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 invention discloses a method and a device for code compression. Wherein, the method comprises the following steps: respectively carrying out coding compression on a basic layer and an enhancement layer of the image according to a preset quantization step length to obtain a compressed code stream; and transmitting the code stream to a receiving end. The invention solves the technical problem that the prior art lacks an effective technology for compressing the character blocks.

Description

Method and apparatus for code compression
Technical Field
The invention relates to the field of application of image coding technology, in particular to a method and a device for coding compression.
Background
The video sequence collected by the computer screen picture is greatly different from the video sequence collected by equipment such as a camera and the like. In computer screens, there are many scenes with text, such as: browsing web pages, playing slides, etc. can present a lot of text.
And intercepting the character image and dividing the character image into blocks according to a fixed size to obtain image block information which is called character blocks for short. Because the character block is based on the specific property, the reasonable distortion degree can be still kept under the condition of larger compression ratio.
The compressed text block has distortion, the compressed content of the text block is called a basic layer, and the difference between the real value of the image and the value after compression recovery is called an enhancement layer. When the base layer and the enhancement layer are transmitted to the decoding end at the same time, the original image can be recovered in a lossless manner after the decoding is finished. In many scenes, it is possible that the image quality recovered by transmitting only the base layer is "not up to standard", while the lossless images recovered by transmitting the base layer and the enhancement layer are "up to standard", but more requirement is "human eye lossless". And "the human eye is not damaged" is in a state between "not reaching the standard" and "reaching the standard". This state is smaller than lossless without affecting the observation.
The compression algorithms in the mainstream at present are as follows: h.264, h.265, JPEG are more directed to compression of natural pictures. But not ideal for block compression.
Aiming at the problem that the prior art lacks an effective technology for compressing the character block, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for coding compression, which at least solve the technical problem that the prior art lacks an effective technology for compressing a text block.
According to an aspect of the embodiments of the present invention, there is provided a method of encoding compression, including: respectively carrying out coding compression on a basic layer and an enhancement layer of the image according to a preset quantization step length to obtain a compressed code stream; and transmitting the code stream to a receiving end.
Optionally, the encoding and compressing an enhancement layer of the image according to a preset quantization step size to obtain a compressed code stream includes: obtaining a residual value range of the enhancement layer; carrying out interval segmentation on the range of the residual error value according to a preset quantization step length to obtain an interval with equal quantization step length; counting the number with the most frequency in the interval to obtain a quantitative basic value of each interval; and coding and compressing the residual error values in each interval according to the quantization basic values to obtain a compressed code stream.
Further, optionally, the performing interval segmentation on the residual value range according to a preset quantization step size to obtain an interval with an equal quantization step size includes: counting various components in the enhancement layer to obtain a frequency histogram; and carrying out interval segmentation on the range of the residual error value according to a preset quantization step and a frequency histogram to obtain an interval with equal quantization step.
Optionally, the encoding and compressing the residual value in each interval according to the quantization basic value to obtain a compressed code stream includes: reducing the residual values in the intervals according to the quantization basic values to obtain reduced residual values, wherein the reduced residual values respectively correspond to each interval with the same quantization step length; and compressing the reduced residual error value according to the quantization basic value to obtain a compressed code stream.
Further, optionally, sending the code stream to the receiving end includes: sending the code stream to a receiving end according to a preset transmission rule, wherein sending the code stream to the receiving end according to the preset transmission rule comprises: obtaining corresponding values of all intervals to be transmitted according to the relation between the quantitative basic value and the lower limit of each interval; coding and compressing the corresponding value to obtain a code stream; and transmitting the code stream to a receiving end.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for encoding compression, including: the encoding module is used for respectively encoding and compressing the basic layer and the enhancement layer of the image according to the preset quantization step length to obtain a compressed code stream; and the sending module is used for sending the code stream to the receiving end.
Optionally, the encoding module includes: an obtaining unit, configured to obtain a residual value range of the enhancement layer; the segmentation unit is used for segmenting the range of the residual error value according to a preset quantization step length to obtain an interval with the same quantization step length; the statistical unit is used for counting the number with the most frequency in the intervals to obtain the quantitative basic value of each interval; and the coding unit is used for coding and compressing the residual error values in each interval according to the quantization basic values to obtain a compressed code stream.
Further, optionally, the segmentation unit includes: the statistical subunit is used for counting various components in the enhancement layer to obtain a frequency histogram; and the dividing subunit is used for carrying out interval division on the residual value range according to a preset quantization step and a frequency histogram to obtain an interval with the same quantization step.
Optionally, the encoding unit includes: the decrement sub-unit is used for carrying out decrement quantization on residual values in the intervals according to the quantization basic values to obtain reduced residual values, wherein the reduced residual values respectively correspond to the intervals with the same quantization step length; and the coding subunit is used for compressing the reduced residual error value according to the quantization basic value to obtain a compressed code stream.
Further, optionally, the sending module includes: a sending unit, configured to send the code stream to a receiving end according to a preset transmission rule, where the sending unit includes: the acquisition subunit is used for acquiring corresponding values of the intervals to be transmitted according to the relationship between the quantitative basic value and the lower limit of each interval; the compression subunit is used for carrying out coding compression on the corresponding value to obtain a code stream; and the transmitting subunit is used for transmitting the code stream to the receiving end.
According to an aspect of the embodiments of the present invention, a storage medium is provided, where the storage medium includes a stored program, where the program performs the above-mentioned encoding and compression on a base layer and an enhancement layer of an image according to a preset quantization step respectively, to obtain a compressed code stream; and transmitting the code stream to a receiving end.
According to an aspect of the embodiments of the present invention, there is further provided a processor, where the processor is configured to execute a program, and when the program runs, the program executes the above coding compression on the base layer and the enhancement layer of the image according to the preset quantization step length, respectively, to obtain a compressed code stream; and transmitting the code stream to a receiving end.
In the embodiment of the invention, a mode of respectively coding and compressing the base layer and the enhancement layer of the image according to the preset quantization step length is adopted, and the compressed code stream is obtained by respectively coding and compressing the base layer and the enhancement layer of the image according to the preset quantization step length; the code stream is sent to a receiving end, so that the purpose of reducing the code stream is achieved, the technical effect of nearly lossless image/video recovery is achieved, and the technical problem that an effective technology for compressing the character blocks is lacked in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow diagram of a method of code compression according to an embodiment of the present invention;
FIG. 2 is a graph of quantization step size/base layer size comparison in a method of encoding compression according to an embodiment of the present invention;
fig. 3 is a diagram of quantization step size/psnr comparison in a method of coding compression in accordance with an embodiment of the present invention;
FIG. 4 is a flow chart illustrating a method of code compression according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus for encoding compression according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
In accordance with an embodiment of the present invention, there is provided an embodiment of a method of code compression, it being noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than that presented herein.
Fig. 1 is a flow chart of a method of encoding compression according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, respectively carrying out coding compression on a basic layer and an enhancement layer of an image according to a preset quantization step length to obtain a compressed code stream;
and step S104, transmitting the code stream to a receiving end.
In the embodiment of the invention, a mode of respectively coding and compressing the base layer and the enhancement layer of the image according to the preset quantization step length is adopted, and the compressed code stream is obtained by respectively coding and compressing the base layer and the enhancement layer of the image according to the preset quantization step length; the method and the device send the code stream to the receiving end, achieve the purpose of reducing the code stream, thereby realizing the technical effect of nearly lossless after the image/video is restored, and further solving the technical problem that the prior art lacks an effective technology for compressing the character blocks.
Optionally, in step S102, the encoding and compressing of the enhancement layer of the image according to the preset quantization step size to obtain a compressed code stream includes:
step S1021, obtaining the range of residual error values of the enhancement layer;
step S1022, carrying out interval segmentation on the residual value range according to a preset quantization step length to obtain an interval with an equal quantization step length;
step S1023, counting the number with the most frequency in the interval to obtain the quantitative basic value of each interval;
and step S1024, coding and compressing the residual error values in each interval according to the quantization basic values to obtain a compressed code stream.
Further, optionally, in step S1022, the step of performing interval segmentation on the residual value range according to the preset quantization step, and obtaining the interval with the equal quantization step includes:
step S10221, counting various components in the enhancement layer to obtain a frequency histogram;
step S10222, performing interval segmentation on the residual value range according to a preset quantization step and a frequency histogram to obtain an interval with an equal quantization step.
Optionally, in step S1024, the residual values in each interval are encoded and compressed according to the quantization basic value, and the obtaining of the compressed code stream includes:
step S10241, the residual values in the intervals are subjected to decrement according to the quantization basic values to obtain the decremented residual values, wherein the decremented residual values respectively correspond to each interval with the same quantization step size;
and step S10242, compressing the reduced residual error value according to the quantization basic value to obtain a compressed code stream.
Further, optionally, the sending the code stream to the receiving end in step S104 includes:
step S1041, sending the code stream to the receiving end according to a preset transmission rule, wherein sending the code stream to the receiving end according to the preset transmission rule includes: obtaining corresponding values of all intervals to be transmitted according to the relation between the quantitative basic value and the lower limit of each interval; coding and compressing the corresponding value to obtain a code stream; and transmitting the code stream to a receiving end.
In summary, in many scenes, it is possible that the image quality recovered by transmitting only the base layer is "not up to standard", while the lossless images recovered by transmitting the base layer and the enhancement layer are "up to standard", but more requirements are "human eye lossless". And "the human eye is not damaged" is in a state between "not reaching the standard" and "reaching the standard". This state is smaller than lossless without affecting the observation.
In the coding compression method provided by the application, the most important characteristic of the text block is that the main energy is concentrated in a few pixels, for example, an article displayed as a black word on a screen, and the main energy is concentrated in white pixels and black pixels. Thereby defining the pixel domain with concentrated energy as the primary color and the others as the escape color.
The basic color is determined according to the frequency histogram of the character block, and the basic color code table is obtained after the basic color is determined. And (3) according to the basic colors and the escape colors, coding the pixel points in the character block according to the corresponding sequence numbers (for example, determining four basic colors, the sequence numbers are 0, 1, 2 and 3, and the sequence numbers of all the escape colors are 4), and introducing prediction in the coding process.
Namely, whether the YUV three components of each pixel point are equal to the YUV three components of the pixel point on the left side or not is judged, and if the YUV three components are equal, the symbol L is used for representing the YUV three components; whether the YUV three components of the pixel points are equal or not is judged, and if the YUV three components are equal, a symbol U is used for representing; if not, the symbol O is used. Thereby obtaining a prediction index code table. For the pixel point with the symbol of O, because the value of the pixel point can not be obtained according to the neighborhood, the code table corresponding to O data needs to be compiled. In the previous step, the escape colors are uniformly numbered as 4, so that the escape color corresponding code table needs to be written. And finally, the basic color code table, the prediction index code table, the O data code table and the escape color code table are coded and transmitted.
FIG. 2 is a graph of quantization step size/base layer size comparison in a method of encoding compression according to an embodiment of the present invention; fig. 3 is a diagram of quantization step size/psnr comparison in a method of coding compression in accordance with an embodiment of the present invention; as shown in fig. 2 and fig. 3, to achieve near lossless effect, the base layer code stream is increased geometrically by adjusting the quantization step size when the base layer is encoded. But this is not a desirable result. It is also currently the main solution to make the picture nearly lossless by reducing the quantization step size of the base layer. Note in particular that no enhancement layer is transmitted in this scheme.
In the coding compression method provided by the application, a reasonable quantization step size is selected to obtain the base layer and then the base layer is transmitted, and the enhancement layer is also subjected to quantization transmission. And the receiving end combines the base layer and the enhancement layer and displays the combined layer. Therefore, not only the whole code stream is effectively controlled, but also a higher Peak Signal to Noise Ratio (psnr for short) can be obtained.
Further analysis is performed on the several sets of data described above, for convenience of presentation below.
Case 1: when the quantization step size of the basic color layer is 1 and the quantization step size of the escape color is 4, the error is between [ -2, +2 ];
case 2: when the bl quantization step size is 4 and the escape color quantization step size is 16, the error is between-8 and + 8.
It can be easily found from the above two cases that when the pixel error is reduced from [ -8, +8] to [ -2, +2] to reach a near lossless image, the base layer code stream is doubled. It should be noted that, for the transmission of computer pictures, in many application scenarios, the required definition of the base layer transmission is already high after recovery. For case 2 above, psnr was 43.54. Distortion is difficult to see without contrast with the original image. The technical problem to be solved by the coding compression method provided by the application is as follows: how better case 1 is reached from case 2.
Specifically, fig. 4 is a schematic flowchart of a method for encoding and compressing according to an embodiment of the present invention, and as shown in fig. 4, the method for encoding and compressing provided by the present application specifically includes the following steps:
for case 2, the residual values of the enhancement layer Y, U, V range [ -8, +8 ]. A value of 0 indicates that the point value is equal to the original image value and does not need to be adjusted. That is, the range of residual values that need to be processed includes: the values of [ -8, -1] and [1,8 ].
The Y component is described below, and the U and V component methods are identical.
1. Counting a Y component frequency histogram in a frame;
2. dividing the residual value range into 6 intervals by taking 3 as a step length comprises the following steps: (-8, -7), (-6, -5, -4), (-3, -2, -1), (1, 2, 3), (4, 5, 6), (7, 8);
3. counting the number with the highest frequency of occurrence in the 6 intervals respectively and defining the number as a quantization basic value; for example, 1 appears at most in (1, 2, 3), and 1 is the quantization base value of the region;
4. quantizing the corresponding value into a quantized base value; (in the third step, 1, 2 and 3 are quantized into 1 with the highest occurrence frequency);
5. by the above processing, the residual value changes from 17 values to 7 values. The corresponding numbers are-3, -2, -1, 0, 1, 2 and 3;
6. transmitting the corresponding relation codes; the transmission is carried out according to 6 values from small to large (0 does not need to be transmitted);
the transmission rule is as follows: quantization base value-interval lower limit; for example, the quantization base value corresponding to the (-8, -7) interval is-7, and it is sufficient to transmit 1 since the corresponding position is known. Wherein, the quantization basic value of the (-8, -7) and (7, 8) intervals can be represented by 1-bit binary system, the other 4 intervals can be represented by 2-bit binary system, and the transmission needs 2 bits in total;
7. and (4) carrying out coding transmission on the corresponding number [ -3,3] by using an arithmetic coder.
Through the above processing, the error range of each pixel of the restored image and the original image is [ -2, +2 ]. The Peak Signal to Noise Ratio (psnr) is substantially the same as that in case 1, but the base layer plus enhancement layer code stream is smaller than that in case 1.
In the coding compression method provided by the application, for the text block, when the image/video is required to be restored, the text block is nearly lossless, and besides indexes such as quantization parameters of a base layer and the like, an effective scheme for compressing and adjusting an enhancement layer is provided; moreover, a set of near lossless compression method is provided under the condition that human eyes can hardly recognize, and compared with lossless compression, the code stream is greatly reduced.
Example two
According to another aspect of the embodiments of the present invention, there is provided an apparatus for encoding compression, and fig. 5 is a schematic structural diagram of the apparatus for encoding compression according to the embodiments of the present invention, as shown in fig. 5, including:
the encoding module 52 is configured to encode and compress the base layer and the enhancement layer of the image according to a preset quantization step size, respectively, to obtain a compressed code stream; and a sending module 54, configured to send the code stream to a receiving end.
In the embodiment of the invention, a mode of respectively coding and compressing the base layer and the enhancement layer of the image according to the preset quantization step length is adopted, and the compressed code stream is obtained by respectively coding and compressing the base layer and the enhancement layer of the image according to the preset quantization step length; the code stream is sent to a receiving end, so that the purpose of reducing the code stream is achieved, the technical effect of nearly lossless image/video recovery is achieved, and the technical problem that an effective technology for compressing the character blocks is lacked in the prior art is solved.
Optionally, the encoding module 52 includes: an obtaining unit, configured to obtain a residual value range of the enhancement layer; the segmentation unit is used for segmenting the range of the residual error value according to the preset quantization step length to obtain an interval with equal quantization step length; the statistical unit is used for counting the number with the most frequency in the interval to obtain the quantitative basic value of each interval; and the coding unit is used for coding and compressing the residual error value in each interval according to the quantization basic value to obtain the compressed code stream.
Further, optionally, the segmentation unit includes: the statistical subunit is used for counting various components in the enhancement layer to obtain a frequency histogram; and the dividing subunit is used for carrying out interval division on the residual value range according to the preset quantization step length and the frequency histogram to obtain an interval with the same quantization step length.
Optionally, the encoding unit includes: a decrement sub-unit, configured to perform decrement on residual values in the intervals according to the quantization basic values to obtain reduced residual values, where the reduced residual values respectively correspond to the intervals of the equal quantization step sizes; and the coding subunit is used for compressing the reduced residual error value according to the quantization basic value to obtain the compressed code stream.
Further, optionally, the sending module 54 includes: a sending unit, configured to send the code stream to the receiving end according to a preset transmission rule, where the sending unit includes: the obtaining subunit is configured to obtain a corresponding value of each interval to be transmitted according to a relationship between the quantized basic value and each interval lower limit; the compression subunit is used for carrying out coding compression on the correspondence to obtain the code stream; and the transmitting subunit is used for transmitting the code stream to the receiving end.
EXAMPLE III
According to an aspect of the embodiments of the present invention, a storage medium is provided, where the storage medium includes a stored program, where the program performs the above-mentioned encoding and compression on a base layer and an enhancement layer of an image according to a preset quantization step respectively, to obtain a compressed code stream; and sending the code stream to a receiving end.
Example four
According to an aspect of the embodiments of the present invention, there is further provided a processor, where the processor is configured to execute a program, and when the program runs, the program executes the above coding compression on the base layer and the enhancement layer of the image according to the preset quantization step length, respectively, to obtain a compressed code stream; and sending the code stream to a receiving end.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (4)

1. A method of code compression, comprising:
respectively carrying out coding compression on a basic layer and an enhancement layer of the image according to a preset quantization step length to obtain a compressed code stream;
transmitting the code stream to a receiving end;
the method comprises the following steps of carrying out coding compression on an enhancement layer of an image according to a preset quantization step length to obtain a compressed code stream, wherein the code stream comprises: obtaining a range of residual values of the enhancement layer; carrying out interval segmentation on the residual value range according to the preset quantization step length to obtain an interval with equal quantization step length; counting the number with the most frequency in the interval to obtain a quantitative basic value of each interval; coding and compressing the residual error value in each interval according to the quantization basic value to obtain the compressed code stream;
the encoding and compressing the residual error value in each interval according to the quantization basic value to obtain the compressed code stream comprises: reducing the residual values in the intervals according to the quantization basic values to obtain reduced residual values, wherein the reduced residual values respectively correspond to the intervals of the equal quantization step sizes; compressing the reduced residual error value according to the quantization basic value to obtain the compressed code stream; compressing the reduced residual error value according to the quantization basic value to obtain the compressed code stream, wherein the compressing the reduced residual error value according to the quantization basic value comprises: obtaining corresponding values of the intervals to be transmitted according to the relation between the quantitative basic value and the lower limit of each interval; and carrying out coding compression on the corresponding value to obtain the code stream.
2. The method of claim 1, wherein the step of performing interval segmentation on the residual value range according to the preset quantization step to obtain an interval with an equal quantization step comprises:
counting various components in the enhancement layer to obtain a frequency histogram;
and carrying out interval segmentation on the range of the residual error value according to the preset quantization step length and the frequency histogram to obtain an interval with the same quantization step length.
3. An apparatus for code compression, comprising:
the encoding module is used for respectively encoding and compressing the basic layer and the enhancement layer of the image according to the preset quantization step length to obtain a compressed code stream;
the sending module is used for sending the code stream to a receiving end;
the encoding module includes: an obtaining unit, configured to obtain a residual value range of the enhancement layer; the segmentation unit is used for segmenting the range of the residual error value according to the preset quantization step length to obtain an interval with equal quantization step length; the statistical unit is used for counting the number with the most frequency in the interval to obtain the quantitative basic value of each interval; the coding unit is used for coding and compressing the residual error value in each interval according to the quantization basic value to obtain the compressed code stream;
the encoding unit includes: a decrement sub-unit, configured to perform decrement on residual values in the intervals according to the quantization basic values to obtain reduced residual values, where the reduced residual values respectively correspond to the intervals of the equal quantization step sizes; the coding subunit is used for compressing the reduced residual error value according to the quantization basic value to obtain a compressed code stream; wherein the coding sub-unit comprises: obtaining corresponding values of the intervals to be transmitted according to the relation between the quantitative basic value and the lower limit of each interval; and carrying out coding compression on the corresponding value to obtain the code stream.
4. The apparatus of claim 3, wherein the segmentation unit comprises:
the statistical subunit is used for counting various components in the enhancement layer to obtain a frequency histogram;
and the dividing subunit is used for carrying out interval division on the residual value range according to the preset quantization step length and the frequency histogram to obtain an interval with the same quantization step length.
CN201810502817.7A 2018-05-23 2018-05-23 Method and apparatus for code compression Active CN108632612B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810502817.7A CN108632612B (en) 2018-05-23 2018-05-23 Method and apparatus for code compression

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810502817.7A CN108632612B (en) 2018-05-23 2018-05-23 Method and apparatus for code compression

Publications (2)

Publication Number Publication Date
CN108632612A CN108632612A (en) 2018-10-09
CN108632612B true CN108632612B (en) 2021-10-08

Family

ID=63690186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810502817.7A Active CN108632612B (en) 2018-05-23 2018-05-23 Method and apparatus for code compression

Country Status (1)

Country Link
CN (1) CN108632612B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007024106A1 (en) * 2005-08-24 2007-03-01 Samsung Electronics Co., Ltd. Method for enhancing performance of residual prediction and video encoder and decoder using the same
CN101087415A (en) * 2007-06-08 2007-12-12 北京中星微电子有限公司 An image compression method and device
CN102833542A (en) * 2012-08-09 2012-12-19 芯原微电子(北京)有限公司 Device and method for increasing coding speed of quality enhancement layer in scalable video coding
WO2014002446A1 (en) * 2012-06-27 2014-01-03 Canon Kabushiki Kaisha Coding method and decoding mehtod of a quantization matrix
CN107147913A (en) * 2017-05-16 2017-09-08 西安万像电子科技有限公司 The transmission method and device of character block

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101452713B1 (en) * 2009-10-30 2014-10-21 삼성전자주식회사 Method and apparatus for encoding and decoding coding unit of picture boundary

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007024106A1 (en) * 2005-08-24 2007-03-01 Samsung Electronics Co., Ltd. Method for enhancing performance of residual prediction and video encoder and decoder using the same
CN101087415A (en) * 2007-06-08 2007-12-12 北京中星微电子有限公司 An image compression method and device
WO2014002446A1 (en) * 2012-06-27 2014-01-03 Canon Kabushiki Kaisha Coding method and decoding mehtod of a quantization matrix
CN102833542A (en) * 2012-08-09 2012-12-19 芯原微电子(北京)有限公司 Device and method for increasing coding speed of quality enhancement layer in scalable video coding
CN107147913A (en) * 2017-05-16 2017-09-08 西安万像电子科技有限公司 The transmission method and device of character block

Also Published As

Publication number Publication date
CN108632612A (en) 2018-10-09

Similar Documents

Publication Publication Date Title
CN107483934B (en) Coding and decoding method, device and system
CN110446041B (en) Video encoding and decoding method, device, system and storage medium
CN108271024B (en) Image coding and decoding method and device
US10182235B2 (en) Hardware efficient sparse FIR filtering in layered video coding
CN104581177B (en) Image compression method and device combining block matching and string matching
CN104853209A (en) Image coding and decoding method and device
KR20050027442A (en) Method of compressing still pictures for mobile devices
CN108881913B (en) Method and apparatus for image encoding
WO2012138568A1 (en) System and method for encoding and decoding anti-aliased video data
CN102308582B (en) Method for the segmentation encoding of an image
CN106331716B (en) Video-frequency compression method and device
CN111429357A (en) Training data determination method, video processing method, device, equipment and medium
CN106604032B (en) Method and device for compressing Chinese character blocks in image and method and device for compressing image
CN110692245A (en) Image processing for compression
JP2024520151A (en) Feature data encoding and decoding method and apparatus
CN108632612B (en) Method and apparatus for code compression
CN107197295B (en) A kind of coded system and method
CN106954074B (en) Video data processing method and device
CN114222127A (en) Video coding method, video decoding method and device
CN108933945B (en) GIF picture compression method, device and storage medium
Abd-Elhafiez New approach for color image compression
CN108235038B (en) Method and device for image coding, decoding and compressing
CN109145610B (en) Picture hiding method and device, picture restoring method and device and terminal equipment
CN106791841B (en) Method for compressing image and device
KR100406535B1 (en) Method of image compression and device for the same

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
TA01 Transfer of patent application right

Effective date of registration: 20210913

Address after: Room 2563, building 11, 6055 Jinhai Road, Fengxian District, Shanghai, 201499

Applicant after: Shanghai Jingxiang Microelectronics Co.,Ltd.

Address before: Room 302, 3 / F, workshop 4, 3G intelligent terminal Industrial Park, 8 Tangyan South Road, hi tech Zone, Xi'an City, Shaanxi Province 710075

Applicant before: XI'AN VANXVM ELECTRONICS TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant