WO2015078131A1 - 图像压缩方法和装置 - Google Patents
图像压缩方法和装置 Download PDFInfo
- Publication number
- WO2015078131A1 WO2015078131A1 PCT/CN2014/075196 CN2014075196W WO2015078131A1 WO 2015078131 A1 WO2015078131 A1 WO 2015078131A1 CN 2014075196 W CN2014075196 W CN 2014075196W WO 2015078131 A1 WO2015078131 A1 WO 2015078131A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- processed
- frequency domain
- coefficients
- coefficient
- Prior art date
Links
- 238000007906 compression Methods 0.000 title claims abstract description 212
- 230000006835 compression Effects 0.000 title claims abstract description 206
- 238000000034 method Methods 0.000 title claims abstract description 76
- 238000013139 quantization Methods 0.000 claims description 138
- 238000012545 processing Methods 0.000 claims description 89
- 239000011159 matrix material Substances 0.000 claims description 64
- 230000009467 reduction Effects 0.000 claims description 43
- 230000009466 transformation Effects 0.000 claims description 42
- 230000008569 process Effects 0.000 claims description 14
- 238000007619 statistical method Methods 0.000 claims description 9
- 230000001131 transforming effect Effects 0.000 claims description 9
- 238000011946 reduction process Methods 0.000 description 21
- 238000010586 diagram Methods 0.000 description 15
- 230000006870 function Effects 0.000 description 6
- 238000004458 analytical method Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 230000002349 favourable effect Effects 0.000 description 4
- 238000003672 processing method Methods 0.000 description 3
- 230000003044 adaptive effect Effects 0.000 description 2
- 230000003247 decreasing effect Effects 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 230000035508 accumulation Effects 0.000 description 1
- 238000009825 accumulation Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
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/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/154—Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
-
- 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/124—Quantisation
-
- 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/132—Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
-
- 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/136—Incoming video signal characteristics or properties
- H04N19/14—Coding unit complexity, e.g. amount of activity or edge presence estimation
-
- 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/18—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 a set of transform coefficients
-
- 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/48—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using compressed domain processing techniques other than decoding, e.g. modification of transform coefficients, variable length coding [VLC] data or run-length data
-
- 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/40—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
Definitions
- the present invention relates to the field of image processing, and in particular, to an image compression method and apparatus. Background technique
- the JPEG (Joint Photographic Experts Group) compression standard has 10 times the compression efficiency in the case of subjective quality before and after compression. This compression efficiency cannot meet the compression and upload sharing requirements of existing HD images.
- Sina Weibo which first downsamples the resolution of the image and then uses the JPEG compression standard to compress and compress the image.
- the resolution of the HD image can be reduced by about 1/16, but it greatly affects the image. Subjective quality. Summary of the invention
- the technical problem to be solved by the present invention is how to improve the compression efficiency of an image without reducing the image.
- an image compression method including a step of performing a frequency reduction process on a frequency domain coefficient or a quantized coefficient of an image to be processed, where the image compression method includes :
- the frequency domain coefficient is a coefficient after transforming the image
- the quantized coefficient is to quantize the frequency domain coefficient After the coefficient.
- the frequency domain coefficients or the quantized coefficients of the to-be-processed image are subjected to a reduction process according to the texture direction, including:
- the method further includes:
- the determining a texture direction of the image to be processed includes: determining a texture direction of a transform block belonging to the texture image content, where The transform block of the texture image content is a transform block of the image to be processed that does not belong to the flat image content;
- Performing a frequency reduction process on the frequency domain coefficients or the quantized coefficients of the image to be processed according to the texture direction including: performing, according to the texture direction, frequency domain coefficients or quantized coefficients corresponding to transform blocks belonging to the texture image content. Reduced processing.
- the first possible implementation of the first aspect, the second possible implementation of the first aspect, or the third possible implementation of the first aspect, in a fourth possible implementation Before determining the texture direction of the image to be processed, it also includes:
- the frequency domain coefficient includes a DC DC coefficient and an AC AC coefficient
- the determining a texture direction of the image to be processed includes: Instruction manual
- a texture direction of the image to be processed corresponding to the transform block is determined according to a frequency domain AC coefficient of the transform block in the image.
- the frequency domain coefficients include a DC DC coefficient and an AC AC coefficient. Determining whether the image content corresponding to the transform block is a flat image content according to the frequency domain coefficient of each transform block of the to-be-processed image includes:
- the image content corresponding to the transform block is flat image content, otherwise, the image content corresponding to the transform block is texture image content.
- an image compression method including a step of performing a frequency reduction process on a frequency domain coefficient or a quantization coefficient of an image to be processed, the image compression method includes:
- the frequency domain coefficients or quantized coefficients of the transform blocks belonging to the flat image content are subjected to a falling process.
- determining, according to a frequency domain coefficient of each of the transform blocks of the to-be-processed image, whether the image content corresponding to the transform block is a flat image content the method further includes:
- the code information includes at least one of a frequency domain coefficient, a quantization matrix, an image resolution, and an image size of the image to be processed; according to the frequency domain coefficient of the image to be processed, or according to a quantization factor in the quantization matrix Or determining a compression strength of the image to be processed according to the image resolution and the image size; determining, according to the compression strength, whether the image to be processed needs to be compressed, and if compression processing is required The strength of the compression process is determined.
- the frequency domain coefficient includes a DC DC coefficient and an AC AC coefficient, where the image is to be processed according to the Determining, by the frequency domain coefficient of each transform block, whether the image content corresponding to the transform block is a flat image content, including:
- the image content corresponding to the transform block is flat image content, otherwise, the image content corresponding to the transform block is texture image content.
- an image compression apparatus including:
- a texture determining unit configured to determine a texture direction of the image to be processed
- a frequency reduction processing unit configured to perform a frequency reduction process on a frequency domain coefficient or a quantization coefficient of the image to be processed according to the texture direction, where the frequency domain coefficient is a coefficient obtained by transforming an image, and the quantization coefficient is a The quantized coefficients of the frequency domain coefficients are described.
- the attenuating processing unit is configured to acquire, according to the texture direction, the frequency domain region or the quantized coefficient energy concentration region and non-energy Description
- a concentration region where the energy concentration region is greater than a sum of frequency domain coefficient magnitudes or quantization coefficient magnitudes of the non-energy concentration region; one or more frequency domain coefficients or quantization in the non-energy concentration region The coefficient is reduced.
- the image compression apparatus further includes:
- a flat determining unit configured to determine, according to a frequency domain coefficient of each transform block of the image to be processed, whether the image content corresponding to the transform block is a flat image content, where the transform block is pre-divided from the image to be processed a block that performs frequency domain transformation;
- the reduction processing unit is further configured to perform a frequency reduction process on a frequency domain coefficient or a quantization coefficient of a transform block belonging to the flat image content.
- the texture determining unit is further configured to determine a texture direction of a transform block that belongs to the texture image content, where the texture image belongs to The transform block of the content is a transform block of the image to be processed that does not belong to the flat image content;
- the reduction processing unit is further configured to perform a frequency reduction process on a frequency domain coefficient or a quantization coefficient corresponding to the transform block belonging to the texture image content according to the texture direction.
- the image compression device further includes:
- a decoding unit configured to decode the to-be-processed image, to obtain decoding information of the to-be-processed image, where the decoding information includes a frequency domain coefficient, a quantization matrix, an image resolution, and an image size of the to-be-processed image At least one item;
- a statistical analysis unit configured to determine a compression strength of the image to be processed according to the frequency domain coefficient of the image to be processed, or according to a quantization factor in the quantization matrix, or according to the image resolution and image size And determining, according to the compression strength, whether the image to be processed needs to be subjected to compression processing, and determining the strength of the compression processing if compression processing is required.
- the frequency domain coefficient includes a DC DC coefficient and an AC AC coefficient
- the texture determining unit is specifically configured to determine, according to a frequency domain AC coefficient of the transform block in the image, The texture direction of the image to be processed corresponding to the transform block.
- the frequency domain coefficient includes a DC DC coefficient and an AC AC coefficient
- the flat determination unit is specifically used to:
- the image content corresponding to the transform block is flat image content, otherwise, the image content corresponding to the transform block is texture image content.
- an image compression apparatus including:
- a flat determining unit configured to determine, according to a frequency domain coefficient of each transform block of the image to be processed, whether the image content corresponding to the transform block is a flat image content, where the transform block is pre-divided from the image to be processed a block of frequency domain transform;
- the image compression apparatus further includes: a decoding unit, configured to decode the to-be-processed image, obtain decoding information of the to-be-processed image, and the decoding information Include at least one of a frequency domain coefficient, a quantization matrix, an image resolution, and an image size of the image to be processed;
- a statistical analysis unit configured to determine a compression strength of the image to be processed according to the frequency domain coefficient of the image to be processed, or according to a quantization factor in the quantization matrix, or according to the image resolution and image size And determining, according to the compression strength, whether the image to be processed needs to be subjected to compression processing, and determining the strength of the compression processing if compression processing is required.
- the flat determining unit is specifically configured to:
- the image content corresponding to the transform block is flat image content, otherwise, the image content corresponding to the transform block is texture image content.
- the frequency domain coefficients of the image to be processed are subjected to the amplitude reduction processing, and the compression efficiency can be improved while not affecting the subjective quality of the image to be processed.
- Figure la is a schematic flowchart of an image compression method according to Embodiment 1 of the present invention.
- FIG. 1b and FIG. 1c are schematic diagrams showing frequency domain coefficients of a transform block in an image compression method according to Embodiment 1 of the present invention
- FIG. 1 is a schematic diagram of an encoder used in an image compression method according to Embodiment 1 of the present invention
- FIG. 2 is a schematic flowchart of an image compression method according to Embodiment 2 of the present invention
- FIG. 3a is a schematic flowchart of an image compression method according to Embodiment 3 of the present invention.
- FIG. 3b is a schematic diagram of an encoder and a decoder used in an image compression method according to Embodiment 3 of the present invention.
- FIG. 4 is a schematic flowchart of an image compression method according to Embodiment 4 of the present invention.
- FIG. 5 is a structural block diagram of an image compression apparatus according to Embodiment 5 of the present invention.
- FIG. 6 is a structural block diagram of an image compression apparatus according to Embodiment 6 of the present invention.
- FIG. 7 is a structural block diagram of an image compression apparatus according to Embodiment 7 of the present invention.
- Figure 8 is a block diagram showing the structure of an image compression apparatus according to an eighth embodiment of the present invention. Specific actual 3 ⁇ 4 ⁇
- FIG. 1 is a schematic flowchart diagram of an image compression method according to Embodiment 1 of the present invention.
- the image compression method includes a process of performing a frequency reduction process on a frequency domain coefficient or a quantized coefficient of an image to be processed, and the image compression method may specifically include:
- Step 101 Determine a texture direction of an image to be processed
- FIG. 1b and FIG. 1c are schematic diagrams showing frequency domain coefficients of a transform block in an image compression method according to Embodiment 1 of the present invention.
- a frequency domain coefficient is used as an 8*.
- the matrix of 8 is represented by i in the horizontal direction and by j in the longitudinal direction.
- the frequency domain coefficients of an 8*8 transform block can also be arranged in the order of 0 ⁇ 63.
- the frequency domain coefficients may be quantized according to the quantization factors in the quantization matrix of the image to be processed to obtain quantized coefficients. For example, for a certain image to be processed, a gradation quantization matrix can be used. The quantization factor of the low frequency coefficient of the quantization matrix is small, and the quantization factor of the high frequency is large.
- the quantization matrix may be adaptively changed according to the specific content of the image to be processed, and the same quantization matrix may be used for multiple images, or one quantization matrix may be corresponding to each image, or each transformation block corresponds to one quantization matrix, and 8*8 is transformed into For example, after transforming, the transformed coefficients are quantized by an 8*8 quantization matrix. Examples of luminance and chrominance quantization matrices are as follows: Instruction manual
- the texture direction of the image to be processed may be determined according to the AC AC coefficient of the frequency domain coefficients of the transform block in the image, for example, the following cases are: Instruction manual
- the case where the transform block is a texture having no clear direction is only an example, and there may be other ways of judging the texture direction.
- the texture direction of the transform block is a horizontal texture.
- the texture direction of the transform block is a vertical texture.
- the texture direction of the transform block is a diagonal texture.
- Step 102 Perform, according to the texture direction, a frequency reduction process on a frequency domain coefficient or a quantized coefficient of the image to be processed, where the frequency domain coefficient is a coefficient obtained by transforming an image, and the quantized coefficient is a pair of the frequency The coefficient of the domain coefficient is quantized.
- the reduction processing refers to reducing the amplitude of the absolute value of the frequency domain coefficient or the quantization coefficient.
- the step 102 may include: acquiring, according to the texture direction, an energy concentration region and a non-energy concentration region of the frequency domain coefficient or the quantization coefficient; wherein, the energy concentration region is relatively larger by a frequency domain coefficient amplitude or a quantization coefficient amplitude One or more frequency point locations, the non-energy concentration region is composed of one or more frequency point positions in which the frequency domain coefficient amplitude or the quantization coefficient amplitude is relatively small, and therefore, the energy concentration region is larger than the non-energy concentration region The sum of the amplitudes of the frequency domain coefficients or the sum of the magnitudes of the quantized coefficients is large.
- the energy concentration region may be composed of one or more adjacent or non-adjacent frequency domain coefficients
- the non-energy concentration region may be composed of one or more adjacent or non-adjacent frequency domain coefficients. Then, one or more of the frequency domain coefficients or the quantized coefficients in the non-energy concentrated region may be subjected to a down-modulation process.
- each transform block can be processed separately according to different texture directions.
- the specific frequency domain coefficient reduction processing can be as follows:
- Method 1 Set the frequency domain coefficient directly to 0.
- textures which may not be processed, may be adaptively processed according to the distribution of frequency domain coefficient energy.
- the method of adaptive processing is, for example, in the case of other textures, the position number corresponding to each frequency domain coefficient in the graph lc can represent the approximate distribution of the energy of the frequency domain coefficients, and the frequency of the position number is smaller.
- Method 2 Decrease the magnitude of the coefficient value.
- textures which may not be processed, may be adaptively processed according to the distribution of frequency domain coefficient energy.
- the amplitude of the frequency domain coefficient or the quantized coefficient is mostly positive, and in the case where the magnitude of the frequency domain coefficient or the quantization coefficient is the amplitude, the absolute value of the negative value can be reduced.
- the coefficient has an amplitude of -2, and the amplitude reduction process can set the amplitude to -1 or set to 0.
- FIG. 1D is a schematic diagram of an encoder used in an image compression method according to Embodiment 1 of the present invention. Description
- the encoder may include a discrete cosine transform unit (DCT), a processing unit (Process), a quantization unit (Quantizer), and an entropy encoder (Entropy encoder), wherein the discrete cosine transform unit (DCT) may perform DCT on the input image data, that is, the image to be processed, and the processing unit may be disposed between the discrete cosine transform unit (DCT) and the quantization unit, or may be disposed between the quantization unit and the entropy coding unit. , used to reduce the frequency domain coefficients.
- the quantization unit can quantize the frequency domain coefficients according to the quantization factor in the quantization table.
- the output image data can be obtained by an Entropy encoder.
- the frequency domain coefficients of the image to be processed are subjected to the amplitude reduction processing, and the compression efficiency of the image to be processed can be improved while not affecting the subjective quality of the image to be processed.
- FIG. 2 is a schematic flow chart of an image compression method according to Embodiment 2 of the present invention.
- the components in Fig. 2 having the same reference numerals as those of Fig. la have the same functions, and a detailed description of these components will be omitted for the sake of brevity.
- step 101 it may include:
- Step 201 Determine, according to frequency domain coefficients of each transform block of the to-be-processed image, whether the image content corresponding to the transform block is a flat image content.
- the noise belongs to high frequency information, if it is not filtered, the compression efficiency of the image may be seriously affected.
- the texture of the image is also high-frequency information, so it is possible to lose a lot of high-frequency signals while filtering out the noise information. Therefore, in the embodiment of the present invention, the image to be processed in the frequency domain is subjected to determination of the flat image content, and the noise of the flat image content is filtered out.
- the transform block can be determined Description
- the image content corresponding to the transform block is a flat image content, otherwise, the transform block corresponds to
- the image content is texture image content.
- the image content corresponding to the transform block is a flat image content; otherwise, the image content corresponding to the transform block is a texture image content;
- AC is a frequency domain alternating current coefficient (which may be simply referred to as an AC coefficient) in the transform block
- DC is a frequency domain direct current coefficient (which may be simply referred to as a DC coefficient) in the transform block
- a is a constant.
- the DC coefficient represents the low frequency component in the transform domain; the AC coefficient represents the high frequency component of the transform domain.
- the left side of the formula (1) represents the sum of the squares of all the AC coefficients in each transform block, and the right side represents the square of the DC coefficient in each transform block multiplied by a constant.
- a can take an empirical value such as 0.02.
- the DCT transforms the image to be processed of the data domain from the time (empty) domain to the frequency domain.
- the coefficient, AC coefficient can also be called the AC component of the frequency domain coefficient.
- Step 202 Perform a frequency reduction process on a frequency domain coefficient or a quantization coefficient of a transform block belonging to the flat image content.
- the flat image content and the texture image content may be distinguished in the image to be processed according to the frequency domain coefficients of the respective transform blocks of the image to be processed, and the transform blocks belonging to the flat image content are performed.
- the filtering process can reduce the amplitude of the frequency domain coefficients of the transform block belonging to the flat image content.
- the Gaussian frequency domain filter is used to process the frequency domain coefficients of the transform block belonging to the flat image content.
- the specific processing method can be:
- the Gaussian frequency domain filter can also be designed as an 8*8 filter, and then each frequency domain coefficient of a transform block is corresponding to it in the 8*8 region. The filter coefficients of the position are multiplied to obtain the final processed frequency domain coefficient value.
- the intensity of the Gaussian frequency domain filter can be adaptively adjusted according to the image content or the quantization factor in the quantization matrix.
- the coefficient DC (the number in the upper left corner after DCT) can be left unprocessed, so the filter coefficient corresponding to DC is always 1.
- different intensity filters can be used for different texture directions; or the frequency domain coefficients can be directly quantized for different texture directions.
- the post coefficient amplitude is adjusted.
- the frequency domain coefficient of the image to be processed may be reduced according to the texture direction, as shown in the first embodiment; or the frequency domain coefficient of the texture image content may be reduced according to the texture direction, so that the step 101 may be specifically Includes:
- Step 203 Determine a texture direction of a transform block belonging to the texture image content, where Description
- the transform block of the texture image content is a transform block of the image to be processed that does not belong to the flat image content.
- step 102 may specifically include:
- Step 204 Perform, according to the texture direction, a frequency reduction process on a frequency domain coefficient corresponding to the transform block that belongs to the texture image content.
- the frequency domain coefficients corresponding to the transform block of the image to be processed are subjected to the amplitude reduction processing, and the compression efficiency of the image to be processed can be improved while not affecting the subjective quality of the image to be processed.
- the flat image content of the image to be processed is filtered, and the noise of the flat image content can be filtered out, which not only can increase the compression efficiency but also reduce the occupied bandwidth without affecting the subjective quality of the image, and the image to be processed is also No loss of texture detail.
- FIG. 3 is a schematic flowchart of an image compression method according to Embodiment 3 of the present invention.
- the components in Fig. 3a having the same reference numerals as those of Figs. la and 2 have the same functions, and detailed descriptions of these components are omitted for the sake of brevity.
- the method may further include:
- Step 301 Decode the to-be-processed image to obtain decoding information of the to-be-processed image, where the decoding information includes at least one of a frequency domain coefficient, a quantization matrix, an image resolution, and an image size of the to-be-processed image.
- the decoding information includes at least one of a frequency domain coefficient, a quantization matrix, an image resolution, and an image size of the to-be-processed image.
- the image to be processed may have been subjected to compression processing, and the standard decoder using JPEG may decode the already compressed image, and directly obtain the decoding information before the image to be processed.
- the standard decoder using JPEG may decode the already compressed image, and directly obtain the decoding information before the image to be processed.
- the decoding information may mainly include frequency domain coefficients, quantization factors, and image resolution, image size, and the like.
- Step 302 Determine, according to the frequency domain coefficient of the image to be processed, or according to a quantization factor in the quantization matrix, or according to the image resolution and the image size, the compression strength of the image to be processed.
- Step 303 Determine, according to the compression strength, whether the image to be processed needs to be compressed, and determine the strength of the compression process if compression processing is required. If the image to be processed needs to be compressed, step 101 or step 201 is performed; otherwise, step 101 or step 201 is not performed.
- a quantization matrix (Qtable), a frequency domain coefficient (coef), an image resolution, and a compressed size
- Qtable determines the compression strength
- the compression strength (level) is determined by the quantization factor (QtableO) corresponding to the DC coefficient, and the following manner can be adopted:
- Scenario 2 Determine the compression strength based on the value of the frequency domain coefficient (coef). Where the frequency domain coefficient Description
- the frequency domain coefficient may be a DC coefficient, which may be an AC coefficient, and may be a DC+AC coefficient.
- the judgment manner may be that the amplitude of the frequency domain coefficient of the specified frequency point position in each transform block is 0.
- the number of accumulations is averaged, and the content of the current region or image is analyzed to determine the compression strength and the quantization factor.
- Scene 3 Determine the new compression strength based on the image resolution and the compressed image size.
- the image size and image resolution are specifically expressed as follows:
- Image size (byte) image width * image length * bit width / 8;
- Image resolution image width * image length
- different compression intensities may correspond to different quantization matrices. If the intensity is large, the quantization factor in the quantization matrix is large, and the quantization factor in the quantization matrix with small intensity is small; the same compression strength of different images may have the same quantization matrix. , may also be different; different compression strengths, the quantization factors of the same position frequency points may be the same or different; and, in the quantization matrix, and the AC system Description
- the quantization factor corresponding to the number is generally greater than or equal to the quantization factor corresponding to the DC coefficient.
- the quantization matrix may be adaptively changed according to the image content, and the plurality of images may be the same quantization matrix, or one quantization matrix per image, one quantization matrix per region, and one quantization matrix per block. Each quantization matrix can be the same or different. And at the time of encoding, the image is quantized using a new quantization matrix.
- FIG. 3b is a schematic diagram of an encoder and a decoder used in the image compression method according to Embodiment 3 of the present invention.
- the decoder may include: an entropy decoder (Entropy Decoder), and an inverse quantization unit. (Dequantizer), inverse discrete cosine transform unit (IDCT), statistical unit (Statistics) and human visual system (HVS) based analysis unit (HVS analysis).
- the reconstructed image data obtained by decoding the input image data by an Entropy Decoder, an Dequantizer, and an Inverse Discrete Cosine Transform Unit (IDCT) For the image to be processed.
- the encoder may include a discrete cosine transform unit (DCT), a processing unit (Processing), a quantization unit (Quantizer), and an Entropy encoder (Entropy encoder).
- DCT discrete cosine transform unit
- Process Processing
- Quantization Quantization unit
- Entropy encoder Entropy encoder
- the discrete cosine transform unit may perform DCT on the reconstructed image data, and the processing unit may be disposed between the discrete cosine transform unit (DCT) and the quantization unit, or may be disposed between the quantization unit and the entropy coding unit. , used to reduce the frequency domain coefficients.
- the quantization unit can calculate the frequency domain coefficient according to the quantization factor in the quantization matrix (Quantization table) Description
- the output image data can be obtained by an Entropy encoder.
- the frequency domain coefficients of the image to be processed are subjected to the amplitude reduction processing, and the compression efficiency of the image to be processed can be improved while not affecting the subjective quality of the image to be processed.
- the flat image content of the image to be processed is filtered, and the noise of the flat image content can be filtered out, which not only can increase the compression efficiency but also reduce the occupied bandwidth without affecting the subjective quality of the image, and the image to be processed is also No loss of texture detail.
- decoding the image to be processed that has been compressed may obtain the decoding information before the image in advance, thereby determining whether the compression can be further compressed according to the compression strength of the image, and more favorable to controlling the subjective quality after compression.
- the image compression method may include a step of performing a frequency reduction process on the frequency domain coefficients or the quantized coefficients of the image to be processed, and the image compression method may specifically include:
- Step 401 Determine, according to frequency domain coefficients of each transform block of the image to be processed, whether the transform block belongs to flat image content.
- a sum of squares of all AC coefficients in the transform block is smaller than a product of a square sum of a DC coefficient and a constant in the transform block, and if yes, the image content corresponding to the transform block is a flat image. Content, otherwise, the image content corresponding to the transform block is texture image content.
- Step 402 Enter a frequency domain coefficient or a quantization coefficient of a transform block belonging to the flat image content Description
- step 402 refer to the related description of the process of the reduction processing in the first embodiment.
- step 401 it may also include:
- Step 501 Decode the to-be-processed image to obtain decoding information of the to-be-processed image, where the decoding information includes at least one of a frequency domain coefficient, a quantization matrix, an image resolution, and an image size of the to-be-processed image.
- the decoding information includes at least one of a frequency domain coefficient, a quantization matrix, an image resolution, and an image size of the to-be-processed image.
- Step 502 Determine, according to the frequency domain coefficient of the to-be-processed image, or according to a quantization factor in the quantization matrix, or according to the image resolution and an image size, a compression strength of the image to be processed;
- Step 503 Determine, according to the compression strength, whether the image to be processed needs to be compressed, and determine the strength of the compression process if compression processing is required.
- the steps 501 to 503 may refer to the related description of the process of determining the compressive strength in the third embodiment.
- the flat image content of the image to be processed is filtered, and the noise of the flat image content can be filtered out, which can not only increase the compression efficiency but also reduce the occupied bandwidth without affecting the subjective quality of the image, and the image to be processed is not processed. Will lose texture details.
- decoding the image to be processed that has been compressed may obtain the decoding information before the image in advance, thereby determining whether the compression can be further compressed according to the compression strength of the image, and more favorable to controlling the subjective quality after compression.
- FIG. 5 is a structural block diagram of an image compression apparatus according to Embodiment 5 of the present invention. As shown in Figure 5, the image Description
- the compression device can include:
- a texture determining unit 51 configured to determine a texture direction of the image to be processed
- the reduction processing unit 53 is configured to perform a frequency reduction process on the frequency domain coefficient or the quantization coefficient of the image to be processed according to the texture direction, where the frequency domain coefficient is a coefficient obtained by transforming an image, and the quantization coefficient is a pair
- the frequency domain coefficients are quantized coefficients.
- the texture determining unit 51 can determine the texture direction of the image to be processed by the AC coefficient of the frequency domain of the image to be processed. After performing frequency domain transform, such as DCT, on the processed image, the frequency domain coefficients of each transform block may be obtained, and then the texture direction of the image to be processed may be determined according to the frequency domain coefficient.
- frequency domain transform such as DCT
- the down-conversion processing unit 53 may perform a down-modulation process on the frequency domain coefficients or the quantized coefficients of the image to be processed according to the texture direction.
- the quantized coefficient is a coefficient that is quantized by the quantization matrix according to the quantization matrix.
- the frequency domain coefficients of the image to be processed are subjected to a reduction processing according to the texture direction of the image to be processed, and the compression efficiency of the image to be processed can be improved while not affecting the subjective quality of the image to be processed.
- FIG. 6 is a structural block diagram of an image compression apparatus according to Embodiment 6 of the present invention.
- the same components in Fig. 6 as those in Fig. 5 have the same functions, and a detailed description of these components will be omitted for the sake of brevity.
- the amplitude reduction processing unit 53 of the image compression device may be configured to acquire the frequency domain coefficient or the quantized coefficient energy concentration region and the non-energy concentration region according to the texture direction.
- the energy concentration region is larger than a sum of frequency domain coefficient amplitudes or quantization coefficient amplitudes of the non-energy concentration region; and one or more frequency domain coefficients or quantization coefficients in the non-energy concentration region are decreased deal with.
- the energy concentration area and the non-energy concentration area refer to the related description of Embodiment 1, and details are not described herein again.
- the image compression apparatus may further include:
- a flat determining unit 61 configured to determine, according to frequency domain coefficients of the respective transform blocks of the to-be-processed image, whether the image content corresponding to the transform block is flat image content, where the transform block is pre-processed from the image to be processed
- the down-modulation processing unit 53 is further configured to perform a frequency reduction process on frequency domain coefficients or quantized coefficients of the transform block belonging to the flat image content.
- the texture determining unit 51 may be further configured to determine a texture direction of a transform block belonging to the texture image content, where the transform block belonging to the texture image content is not in the to-be-processed image a transform block belonging to the flat image content;
- the reduction processing unit 53 is further configured to perform a frequency reduction process on the frequency domain coefficients or the quantized coefficients corresponding to the transform blocks belonging to the texture image content according to the texture direction.
- the image compression apparatus may further include:
- a decoding unit 65 configured to decode the to-be-processed image, to obtain decoding information of the to-be-processed image, where the decoding information includes a frequency domain coefficient, a quantization matrix, an image resolution, and an image size of the to-be-processed image. At least one item;
- the statistical analysis unit 67 is configured to determine, according to the frequency domain coefficient of the image to be processed, or according to a quantization factor in the quantization matrix, or according to the image resolution and image size, Description
- the compression strength of the image is processed; based on the compression strength, it is determined whether compression processing of the image to be processed is required, and the strength of the compression processing is determined if compression processing is required.
- the decoding unit 65 may decode the to-be-processed image that has undergone the compression processing, and the statistical analysis unit 67 determines the compression strength according to the decoding information, so as to determine whether further compression is needed.
- the statistical analysis unit 67 determines the compression strength according to the decoding information, so as to determine whether further compression is needed.
- the frequency domain coefficient may include a DC DC coefficient and an AC AC coefficient.
- the texture determining unit 51 may be specifically configured to determine a transform according to a frequency domain AC coefficient of the transform block in the image. The texture direction of the image to be processed corresponding to the block.
- the flat determining unit 61 may be specifically configured to: determine whether a sum of squares of all AC coefficients in the transform block is greater than a product of a sum of squares and constants of DC coefficients in the transform block. If yes, the image content corresponding to the transform block is flat image content, otherwise, the image content corresponding to the transform block is texture image content.
- formula (2) and related description in the above embodiment of the image compression method refer to formula (2) and related description in the above embodiment of the image compression method.
- the frequency domain coefficients of the image to be processed are subjected to a reduction processing according to the texture direction of the image to be processed, and the compression efficiency of the image to be processed can be improved while not affecting the subjective quality of the image to be processed.
- the flat image content of the image to be processed is filtered, and the noise of the flat image content can be filtered out, which not only can increase the compression efficiency but also reduce the occupied bandwidth without affecting the subjective quality of the image, and the image to be processed is also No loss of texture detail.
- decoding the image to be processed that has been compressed may obtain the decoding information before the image in advance, thereby determining whether the compression can be further compressed according to the compression strength of the image, and more Description
- FIG. 7 is a block diagram showing the structure of an image compression apparatus according to a seventh embodiment of the present invention.
- the image compression device may include:
- a flat determining unit 71 configured to determine, according to a frequency domain coefficient of each transform block of the image to be processed, whether the image content corresponding to the transform block is flat image content, where the transform block is pre-divided from the image to be processed a block that performs frequency domain transform;
- the amplitude reduction processing unit 73 is configured to perform a frequency reduction process on the frequency domain coefficients or the quantization coefficients of the transform blocks belonging to the flat image content.
- the image compression apparatus may further include:
- a decoding unit 75 configured to decode the to-be-processed image to obtain decoding information of the to-be-processed image, where the decoding information includes a frequency domain coefficient, a quantization matrix, an image resolution, and an image size of the to-be-processed image. At least one item;
- a statistical analysis unit 77 configured to determine compression of the image to be processed according to the frequency domain coefficient of the image to be processed, or according to a quantization factor in the quantization matrix, or according to the image resolution and image size Intensity; determining, according to the compression strength, whether compression processing is required on the image to be processed, and determining the strength of the compression processing in a case where compression processing is required.
- the decoding unit 75 may decode the to-be-processed image that has undergone compression processing, and the statistical analysis unit 77 determines the compression strength according to the decoding information, thereby determining whether a further compression is needed. Description
- the flat determining unit may be specifically configured to: determine whether a sum of squares of all AC coefficients in the transform block is smaller than a product of a sum of squares and constants of DC coefficients in the transform block. If yes, the image content corresponding to the transform block is flat image content, otherwise, the image content corresponding to the transform block is texture image content.
- formula (2) and related description in the above embodiment of the image compression method refer to formula (2) and related description in the above embodiment of the image compression method.
- the flat image content of the image to be processed is filtered, and the noise of the flat image content can be filtered out, thereby not only increasing the compression efficiency of the image to be processed but also reducing the occupied bandwidth without affecting the subjective quality of the image. And, the image to be processed does not lose texture details.
- decoding the image to be processed that has been compressed may obtain the decoding information before the image in advance, thereby determining whether the compression can be further compressed according to the compression strength of the image, and more favorable to controlling the subjective quality after compression.
- FIG. 8 is a block diagram showing the structure of an image compression apparatus according to an eighth embodiment of the present invention.
- the image compression device 1100 may be a host server having a computing capability, a personal computer PC, or a portable portable computer or terminal.
- the specific embodiments of the present invention do not limit the specific implementation of the computing node.
- the image compression apparatus 1100 includes a processor 110, a communication interface 1120, a memory 1130, and a bus 1140. Among them, the processor 1110, the communication interface 1120, and the memory 1130 complete communication with each other through the bus 1140.
- the communication interface 1120 is for communicating with a network device, where the network device includes, for example, a virtual machine management center, shared storage, and the like. Instruction manual
- the processor 1110 is for executing a program.
- the processor 1110 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
- ASIC Application Specific Integrated Circuit
- the memory 1130 is used to store programs and data.
- Memory 1130 may include high speed RAM memory and may also include non-volatile memory, such as at least one disk memory.
- Memory 1130 can also be a memory array.
- the memory 1130 may also be partitioned, and the blocks may be combined into a virtual volume according to certain rules.
- the above program may be a program code including computer operating instructions.
- the program may be specifically configured to perform an image compression method, including a step of performing a frequency reduction process on a frequency domain coefficient or a quantized coefficient of an image to be processed, the image compression method comprising:
- the frequency domain coefficient is a coefficient after transforming the image
- the quantized coefficient is to quantize the frequency domain coefficient After the coefficient.
- the frequency domain coefficient or the quantized coefficient of the to-be-processed image is subjected to a reduction process according to the texture direction, including:
- the frequency domain coefficients or quantized coefficients of the transform blocks belonging to the flat image content are subjected to a falling process.
- the determining a texture direction of the image to be processed includes: determining a texture direction of a transform block belonging to the texture image content, where the transform block belonging to the texture image content is the image to be processed a transform block that does not belong to the flat image content;
- Performing a frequency reduction process on the frequency domain coefficients or the quantized coefficients of the image to be processed according to the texture direction including: performing, according to the texture direction, frequency domain coefficients or quantized coefficients corresponding to transform blocks belonging to the texture image content. Reduced processing.
- the method before determining the texture direction of the image to be processed, the method further includes: decoding the image to be processed to obtain decoding information of the image to be processed, where the decoding information includes the image to be processed At least one of a frequency domain coefficient, a quantization matrix, an image resolution, and an image size; according to the frequency domain coefficient of the image to be processed, or according to a quantization factor in the quantization matrix, or according to the image Rate and image size, determining a compression strength of the image to be processed; determining, according to the compression strength, whether compression processing is required on the image to be processed, and determining strength of the compression processing if compression processing is required .
- the frequency domain coefficient includes a DC DC coefficient and an AC AC coefficient
- the determining a texture direction of the image to be processed includes: Instruction manual
- a texture direction of the image to be processed corresponding to the transform block is determined according to a frequency domain AC coefficient of the transform block in the image.
- the frequency domain coefficient includes a DC DC coefficient and an AC AC coefficient, and determining, according to a frequency domain coefficient of each transform block of the image to be processed, whether the image content corresponding to the transform block is For flat image content, including:
- the image content corresponding to the transform block is flat image content, otherwise, the image content corresponding to the transform block is texture image content.
- the program may be further configured to perform an image compression method, including a step of performing a frequency reduction process on a frequency domain coefficient or a quantized coefficient of the image to be processed, the image compression method comprising: each transform block according to the image to be processed a frequency domain coefficient, determining whether the image content corresponding to the transform block is a flat image content, where the transform block is a block that is pre-divided into a frequency domain transform from the image to be processed;
- the frequency domain coefficients or quantized coefficients of the transform blocks belonging to the flat image content are subjected to a falling process.
- the method before determining whether the image content corresponding to the transform block is a flat image content, according to the frequency domain coefficient of each transform block of the image to be processed, the method further includes:
- Decoding the image to be processed to obtain decoding information of the image to be processed, the decoding information including at least one of a frequency domain coefficient, a quantization matrix, an image resolution, and an image size of the image to be processed;
- the strength of the compression process is determined below.
- the frequency domain coefficient includes a DC DC coefficient and an AC AC coefficient, and determining, according to a frequency domain coefficient of each transform block of the image to be processed, whether the image content corresponding to the transform block is For flat image content, including:
- the image content corresponding to the transform block is flat image content, otherwise, the image content corresponding to the transform block is texture image content.
- the frequency domain coefficients of the image to be processed are subjected to the amplitude reduction processing, and the compression efficiency of the image to be processed can be improved while not affecting the subjective quality of the image to be processed.
- the flat image content of the image to be processed is filtered, and the noise of the flat image content can be filtered out, which not only can increase the compression efficiency but also reduce the occupied bandwidth without affecting the subjective quality of the image, and the image to be processed is also No loss of texture detail.
- decoding the image to be processed that has been compressed may obtain the decoding information before the image in advance, thereby determining whether the compression can be further compressed according to the compression strength of the image, and more favorable to controlling the subjective quality after compression.
- the function is implemented in the form of computer software and sold or used as a stand-alone product, it may be considered to some extent that all or part of the technical solution of the present invention (for example, a part contributing to the prior art) is It is embodied in the form of computer software products.
- the computer software product is typically stored in a computer readable non-volatile storage medium, including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform all of the methods of various embodiments of the present invention. Or part of the step.
- the foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本发明涉及一种图像压缩方法和装置,其中,该图像压缩方法,包括对待处理图像的频域系数或量化系数进行降幅处理的步骤,所述图像压缩方法包括:确定待处理图像的纹理方向;根据所述纹理方向,对所述待处理图像的频域系数或量化系数进行降幅处理,所述频域系数为对图像进行变换后的系数,所述量化系数为对所述频域系数进行量化后的系数。本发明实施例根据待处理图像的纹理方向,对待处理图像的频域系数进行降幅处理,在不影响待处理图像的主观质量的同时,可以提高压缩效率。
Description
说 明 书
图像压^法和装置
技术领域
本发明涉及图像处理领域, 尤其涉及一种图像压缩方法和装置。 背景技术
随着移动互联网和智能手机的发展, 图像压缩出现了新进展。 业界对静 态图像压缩效率的研究的主要驱动力来自于移动媒体分享的应用。 由于智能 手机成为媒体采集到应用的集合体, 智能手机的摄像机可以采集 800万分辨 率以上的图像; 图像成为移动互联网富媒体格式中最主要的媒体形式, 手机 浏览网页中包含大量的图像; 微博和微信等社会化媒体应用的火热也使得图 像的快速分享成为必须。
通常, JPEG (Joint Photographic Experts Group, 联合图像专家小组) 压 缩标准在压缩前后主观质量相当的情况下有 10倍的压缩效率,这种压缩效率 不能满足现有高清图像的压缩和上载分享的需求。 目前, 还有一些应用如新 浪微博是将图像的分辨率先进行下采样,再采用 JPEG压缩标准的方法进行编 码压缩, 可以将高清图像分辨率降低约 1/16, 但是却大大影响了图像的主观 质量。 发明内容
技术问题
本发明要解决的技术问题是, 如何提高图像的压缩效率并且不降低图像
说 明 书
的主观质量。
解决方案
为了解决上述技术问题, 根据本发明的一实施例, 第一方面, 提供了一 种图像压缩方法,包括对待处理图像的频域系数或量化系数进行降幅处理的 歩骤, 所述图像压缩方法包括:
确定待处理图像的纹理方向;
根据所述纹理方向,对所述待处理图像的频域系数或量化系数进行降幅 处理, 所述频域系数为对图像进行变换后的系数, 所述量化系数为对所述频 域系数进行量化后的系数。
结合第一方面, 在第一种可能的实现方式中, 根据所述纹理方向, 对所 述待处理图像的频域系数或量化系数进行降幅处理, 包括:
根据所述纹理方向, 获取所述频域系数或量化系数能量集中区域和非能 量集中区域,所述能量集中区域比所述非能量集中区域的频域系数幅值之和 或量化系数幅值之和大;
对所述非能量集中区域中的一个或多个频域系数或量化系数进行降幅 处理。
结合第一方面或第一方面的第一种可能的实现方式,在第二种可能的实 现方式中, 所述确定待处理图像的纹理方向之前, 还包括:
根据所述待处理图像的各个变换块的频域系数, 确定所述变换块对应的 图像内容是否为平坦图像内容,所述变换块为从所述待处理图像中预先划分 的进行频域变换的块;
对属于所述平坦图像内容的变换块的频域系数或量化系数进行降幅处
说 明 书
理。
结合第一方面的第二种可能的实现方式, 在第三种可能的实现方式中, 所述确定待处理图像的纹理方向, 包括: 确定属于纹理图像内容的变换块的 纹理方向, 其中, 属于所述纹理图像内容的变换块为所述待处理图像中不属 于所述平坦图像内容的变换块;
根据所述纹理方向,对所述待处理图像的频域系数或量化系数进行降幅 处理, 包括: 根据所述纹理方向, 对属于所述纹理图像内容的变换块对应的 频域系数或量化系数进行降幅处理。
结合第一方面、 第一方面的第一种可能的实现方式、 第一方面的第二种 可能的实现方式或第一方面的第三种可能的实现方式,在第四种可能的实现 方式中, 确定待处理图像的纹理方向之前, 还包括:
对所述待处理图像进行解码, 获得所述待处理图像的解码信息, 所述解 码信息包括所述待处理图像的频域系数、 量化矩阵、 图像分辨率和图像大小 中的至少一项; 根据所述待处理图像的所述频域系数、或根据所述量化矩阵中的量化因 子、 或根据所述图像分辨率和图像大小, 确定所述待处理图像的压缩强度; 根据所述压缩强度, 确定是否需要对所述待处理图像进行压缩处理, 以 及在需要进行压缩处理的情况下确定所述压缩处理的强度。
结合第一方面、 第一方面的第一种可能的实现方式、 第一方面的第二种 可能的实现方式、第一方面的第三种可能的实现方式或第一方面的第四种可 能的实现方式, 在第五种可能的实现方式中, 所述频域系数包括直流 DC系 数和交流 AC系数, 所述确定待处理图像的纹理方向, 包括:
说 明 书
根据所述图像中的变换块的频域 AC系数, 确定变换块对应的待处理图 像的纹理方向。
结合第一方面的第二种可能的实现方式或第一方面的第三种可能的实现 方式, 在第六种可能的实现方式中, 所述频域系数包括直流 DC系数和交流 AC系数, 所述根据所述待处理图像的各个变换块的频域系数, 确定所述变 换块对应的图像内容是否为平坦图像内容, 包括:
判断所述变换块中所有的 AC系数的平方和是否比所述变换块中的 DC系 数的平方和与常数的乘积小;
如果是, 则所述变换块对应的图像内容为平坦图像内容, 否则, 所述变 换块对应的图像内容为纹理图像内容。
为了解决上述技术问题, 根据本发明的另一实施例, 第二方面, 提供了 一种图像压缩方法,包括对待处理图像的频域系数或量化系数进行降幅处理 的歩骤, 所述图像压缩方法包括:
根据待处理图像的各个变换块的频域系数,确定所述变换块对应的图像 内容是否为平坦图像内容,所述变换块为从所述待处理图像中预先划分的进 行频域变换的块;
对属于所述平坦图像内容的变换块的频域系数或量化系数进行降幅处 理。
结合第二方面, 在第一种可能的实现方式中, 根据待处理图像的各个变 换块的频域系数, 确定所述变换块对应的图像内容是否为平坦图像内容之 m , 还包括:
对所述待处理图像进行解码, 获得所述待处理图像的解码信息, 所述解
说 明 书
码信息包括所述待处理图像的频域系数、 量化矩阵、 图像分辨率和图像大小 中的至少一项; 根据所述待处理图像的所述频域系数、 或根据所述量化矩阵中量化因 子、 或根据所述图像分辨率和图像大小, 确定所述待处理图像的压缩强度; 根据所述压缩强度, 确定是否需要对所述待处理图像进行压缩处理, 以 及在需要进行压缩处理的情况下确定所述压缩处理的强度。
结合第二方面或第二方面的第一种可能的实现方式,在第二种可能的实 现方式中, 所述频域系数包括直流 DC系数和交流 AC系数, 所述根据所述待 处理图像的各个变换块的频域系数, 确定所述变换块对应的图像内容是否为 平坦图像内容, 包括:
判断所述变换块中所有的 AC系数的平方和是否比所述变换块中的 DC系 数的平方和与常数的乘积小;
如果是, 则所述变换块对应的图像内容为平坦图像内容, 否则, 则所述 变换块对应的图像内容为纹理图像内容。
为了解决上述技术问题, 根据本发明的另一实施例, 第三方面, 提供了 一种图像压缩装置, 包括:
纹理确定单元, 用于确定待处理图像的纹理方向;
降幅处理单元, 用于根据所述纹理方向, 对所述待处理图像的频域系数 或量化系数进行降幅处理, 所述频域系数为对图像进行变换后的系数, 所述 量化系数为对所述频域系数进行量化后的系数。
结合第三方面, 在第一种可能的实现方式中, 所述降幅处理单元具体用 于根据所述纹理方向,获取所述频域系数或量化系数能量集中区域和非能量
说 明 书
集中区域,所述能量集中区域比所述非能量集中区域的频域系数幅值之和或 量化系数幅值之和大;对所述非能量集中区域中的一个或多个频域系数或量 化系数进行降幅处理。
结合第三方面或第三方面的第一种可能的实现方式,在第二种可能的实 现方式中, 该图像压缩装置还包括:
平坦确定单元, 用于根据所述待处理图像的各个变换块的频域系数, 确 定所述变换块对应的图像内容是否为平坦图像内容,所述变换块为从所述待 处理图像中预先划分的进行频域变换的块;
所述降幅处理单元, 还用于对属于所述平坦图像内容的变换块的频域系 数或量化系数进行降幅处理。
结合第三方面的第二种可能的实现方式, 在第三种可能的实现方式中, 所述纹理确定单元还用于确定属于纹理图像内容的变换块的纹理方向, 其 中, 属于所述纹理图像内容的变换块为所述待处理图像中不属于所述平坦图 像内容的变换块;
所述降幅处理单元还用于根据所述纹理方向,对属于所述纹理图像内容 的变换块对应的频域系数或量化系数进行降幅处理。
结合第三方面、 第三方面的第一种可能的实现方式、 第三方面的第二种 可能的实现方式或第三方面的第三种可能的实现方式,在第四种可能的实现 方式中, 该图像压缩装置还包括:
解码单元, 用于对所述待处理图像进行解码, 获得所述待处理图像的解 码信息, 所述解码信息包括所述待处理图像的频域系数、 量化矩阵、 图像分 辨率和图像大小中的至少一项;
说 明 书
统计分析单元, 用于根据所述待处理图像的所述频域系数、 或根据所述 量化矩阵中的量化因子、 或根据所述图像分辨率和图像大小, 确定所述待处 理图像的压缩强度; 根据所述压缩强度, 确定是否需要对所述待处理图像进 行压缩处理, 以及在需要进行压缩处理的情况下确定所述压缩处理的强度。
结合第三方面、 第三方面的第一种可能的实现方式、 第三方面的第二种 可能的实现方式、第三方面的第三种可能的实现方式或第三方面的第四种可 能的实现方式, 在第五种可能的实现方式中, 所述频域系数包括直流 DC系 数和交流 AC系数, 所述纹理确定单元具体用于根据所述图像中的变换块的 频域 AC系数, 确定变换块对应的待处理图像的纹理方向。
结合第三方面的第二种可能的实现方式或第三方面的第三种可能的实 现方式, 在第六种可能的实现方式中, 所述频域系数包括直流 DC系数和交 流 AC系数, 所述平坦确定单元具体用于:
判断所述变换块中所有的 AC系数的平方和是否比所述变换块中的 DC系 数的平方和与常数的乘积小;
如果是, 则所述变换块对应的图像内容为平坦图像内容, 否则, 所述变 换块对应的图像内容为纹理图像内容。
为了解决上述技术问题, 根据本发明的另一实施例, 第四方面, 提供了 一种图像压缩装置, 包括:
平坦确定单元, 用于根据待处理图像的各个变换块的频域系数, 确定所 述变换块对应的图像内容是否为平坦图像内容,所述变换块为从所述待处理 图像中预先划分的进行频域变换的块;
降幅处理单元,用于对属于所述平坦图像内容的变换块的频域系数或量
说 明 书
化系数进行降幅处理。
结合第四方面, 在第一种可能的实现方式中, 该图像压缩装置还包括: 解码单元, 用于对所述待处理图像进行解码, 获得所述待处理图像的解 码信息, 所述解码信息包括所述待处理图像的频域系数、 量化矩阵、 图像分 辨率和图像大小中的至少一项;
统计分析单元, 用于根据所述待处理图像的所述频域系数、 或根据所述 量化矩阵中的量化因子、 或根据所述图像分辨率和图像大小, 确定所述待处 理图像的压缩强度; 根据所述压缩强度, 确定是否需要对所述待处理图像进 行压缩处理, 以及在需要进行压缩处理的情况下确定所述压缩处理的强度。
结合第四方面或第四方面的第一种可能的实现方式,在第二种可能的实 现方式中, 所述平坦确定单元具体用于:
判断所述变换块中所有的 AC系数的平方和是否比所述变换块中的 DC系 数的平方和与常数的乘积小;
如果是, 则所述变换块对应的图像内容为平坦图像内容, 否则, 所述变 换块对应的图像内容为纹理图像内容。
有益效果
本发明实施例根据待处理图像的纹理方向,对待处理图像的频域系数进 行降幅处理, 在不影响待处理图像的主观质量的同时, 可以提高压缩效率。
根据下面参考附图对示例性实施例的详细说明, 本发明的其它特征及方 面将变得清楚。 附图说明
说 明 书
包含在说明书中并且构成说明书的一部分的附图与说明书一起示出了 本发明的示例性实施例、 特征和方面, 并且用于解释本发明的原理。
图 la为本发明实施例一的图像压缩方法的流程示意图;
图 lb和图 lc为本发明实施例一的图像压缩方法中一个变换块的频域系 数的示意图;
图 Id为本发明实施例一的图像压缩方法所采用的编码器的示意图; 图 2为本发明实施例二的图像压缩方法的流程示意图;
图 3a为本发明实施例三的图像压缩方法的流程示意图;
图 3b为本发明实施例三的图像压缩方法所采用的编码器和解码器的示 意图;
图 4为本发明实施例四的图像压缩方法的流程示意图;
图 5为本发明实施例五的图像压缩装置的结构框图;
图 6为本发明实施例六的图像压缩装置的结构框图;
图 7为本发明实施例七的图像压缩装置的结构框图;
图 8为本发明实施例八的图像压缩装置的结构框图。 具体实 ¾ ^式
以下将参考附图详细说明本发明的各种示例性实施例、 特征和方面。 附 图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施 例的各种方面, 但是除非特别指出, 不必按比例绘制附图。
在这里专用的词"示例性 "意为 "用作例子、 实施例或说明性"。 这里作为 "示例性"所说明的任何实施例不必解释为优于或好于其它实施例。
说 明 书
另外, 为了更好的说明本发明, 在下文的具体实施方式中给出了众多的 具体细节。 本领域技术人员应当理解, 没有某些具体细节, 本发明同样可以 实施。 在一些实例中, 对于本领域技术人员熟知的方法、 手段、 元件和电路 未作详细描述, 以便于凸显本发明的主旨。
实施例一
图 la为本发明实施例一的图像压缩方法的流程示意图。 如图 la所示, 该 图像压缩方法包括对待处理图像的频域系数或量化系数进行降幅处理的歩 骤, 所述图像压缩方法具体可以包括:
歩骤 101、 确定待处理图像的纹理方向;
具体地, 可以对待处理图像进行频域变换如离散余弦变换 (Discrete Cosine Transform, 简称: DCT) , 得到待处理图像的各个变换块的频域系数。 图 lb和图 lc为本发明实施例一的图像压缩方法中一个变换块的频域系数的 示意图, 如图 lb所示, 在一个 8*8的变换块中, 将频域系数作为一个 8*8的矩 阵, 横向用 i表示, 纵向用 j表示。 如图 lc所示, 还可以将一个 8*8的变换块的 频域系数按照编号从 0~63的顺序排列。
得到频域系数后, 可以根据待处理图像的量化矩阵中的量化因子, 对频 域系数进行量化, 得到量化系数。 例如, 对于某个待处理图像, 可以使用渐 变的量化矩阵, 这种量化矩阵的低频系数的量化因子较小, 高频的量化因子 较大。 量化矩阵可以根据待处理图像的具体内容自适应变化, 可以多个图像 采用同一个量化矩阵, 也可以每个图像对应一个量化矩阵, 或者每个变换块 对应一个量化矩阵, 以 8*8变换为例, 变换后, 用 8*8的量化矩阵对变换后的 系数进行量化, 亮度和色度量化矩阵示例如下:
说 明 书
亮度量化矩阵示例:
{ 16,14,12,20,28,48,62,74,
14,14,16,22,32,70,72,66,
16,16,20,28,48,68,82,68,
22,26,44,68,82,104,96,74,
28,42,66,76,98,124,136,110,
58,76,94, 104, 124, 146, 144, 122,
86,110,114,118,134,120,124,18}
色度量化矩阵示例:
{ 17,22,28,56,118,118,118,118,
22,26,32,80,118,118,118,118,
28,32,68,118,118,118,118,118,
56,80,118,118,118,118,118,118,
118,118,118,118,118,118,118,118,
118,118,118,118,118,118,118,118,
118,118,118,118,118,118,118,118}
此外, 以 8*8的变换块为例, 对待处理图像进行 DCT后, 可以得到 0~63 个频域系数, 其中, 横向用 i表示, i=0~7; 纵向用 j表示, j=0~7; 每个 DCT 的位置参见图 lb。 图像的纹理主要可以分为 4类: 水平方向、 垂直方向、 斜 方向、 其他纹理方向。 对这 4类纹理的判断, 具体可以根据所述图像中的变 换块的频域系数的交流 AC系数, 确定待处理图像的纹理方向, 例如分为以 下情况:
说 明 书
情况一、 如果所述图像的变换块的频域系数 ACcn为 0, 且 AC1()不为 0, 则所述变换块的纹理方向为水平纹理;
情况二、 如果所述图像的变换块的频域系数 ACcn不为 0, 且 AC1()为 0, 且所述变换块的编号为 2的频域系数为 0, 则所述变换块的纹理方向为垂直纹 理;
情况三、如果所述图像的变换块的频域系数 AC(n、 AC1()和 ACU不为 0, 则所述变换块的纹理方向为斜纹理。
其中, 如图 lb所示, 如果将频域系数作为一个矩阵, ACcn为矩阵中 i=0、 j=l的元素, AC1()为矩阵中 i=l、 j=0的元素, ^ 为矩阵中 i=l、 j=l的元素。 综上, 上述情况具体可以表示为以下条件:
满足 (AC01==0且 AC10!=0), 为水平方向;
满足 (AC01 !=0且 AC10==0), 为垂直方向;
满足 (AC01 !=0且 AC10!=0且 ACu ^O), 为斜方向;
如果以上三种情况均不满足, 则所述变换块为没有明确的方向的纹理内 上述情况仅是一种示例, 还可以有其他的判断纹理方向的方式。 例如: 对于 N*N的 DCT变换, 生成的一个 N*N的频域系数矩阵, 其中, i=0~N-l, j=0~N-l。 如果第一行直流系数 ACcn ACom为 0, 且第一列 Ado ACno不为 0 (其中, m和 n小于 N), 则该变换块的纹理方向为水平纹理。 如果第一行直 流系数 ACcn ACom不为 0, 且第一列 AC1()~AC no为 0 (其中, m和 n小于 N), 则该变换块的纹理方向为垂直纹理。 如果第一行直流系数 ACcn ACom不为 0, 且第一列 ACio~AC no不为 0, 且 i=j=0~ AC系数不为 0 (其中, m、 n和
说 明 书
t小于 n), 则该变换块的纹理方向为斜纹理。
歩骤 102、 根据所述纹理方向, 对所述待处理图像的频域系数或量化系 数进行降幅处理, 所述频域系数为对图像进行变换后的系数, 所述量化系数 为对所述频域系数进行量化后的系数。
具体地, 降幅处理是指降低频域系数或量化系数的绝对值的幅值。 歩骤 102可以包括: 根据所述纹理方向, 获取所述频域系数或量化系数的能量集 中区域和非能量集中区域; 其中, 能量集中区域由频域系数幅值或量化系数 幅值相对较大的一个或多个频点位置组成, 非能量集中区域为频域系数幅值 或量化系数幅值相对较小的一个或多个频点位置组成, 因此, 能量集中区域 比所述非能量集中区域的频域系数幅值之和或量化系数幅值之和大。 此外, 能量集中区域可以由一个或多个相邻或不相邻的频域系数组成, 非能量集中 区域可以由一个或多个相邻或不相邻的频域系数组成。 然后, 可以对所述非 能量集中区域中的一个或多个频域系数或量化系数进行降幅处理。
以 8*8的变换块为例, 按照不同的纹理方向, 可以对每个变换块分别进 行处理。
( 1 ) 当某个变换块为水平纹理时, 频域系数的能量将会集中在 i=0&j=0~7的频点位置(能量集中区域),因此将能量较弱的部分 i=l~7&j=0~7 的频点位置 (非能量集中区域) 对应的频域系数的幅值进行处理;
(2) 当某个变换块为垂直纹理时, 频域系数能量将会集中在 i=0~7&j=0 的频点位置(能量集中区域), 因此将能量较弱的部分 i=0~7&j= l~7的频点位 置 (非能量集中区域) 对应的频域系数的幅值进行处理;
( 3 )当某个变换块为斜纹理时, 频域系数能量将会集中在 i=0~ l&j=0~ l
说 明 书
的频点位置(能量集中区域), 因此将能量较弱的部分 i=2~7&j=2~7的频点位 置 (非能量集中区域) 对应的频域系数的幅值进行处理。
具体的频域系数的降幅处理可以采用以下方式:
方式一: 将频域系数直接置为 0。
如果一幅图像采用 N*N的变换, 当某个变换块为水平纹理时, 可以将该 变换块的能量较弱的部分 i=m~N-l&j=n~N- l的系数中幅值为 1的频域系数置 为 0, 其中, m〉=l, ιι〉=0。
当某个变换块为垂直纹理时, 可以将该变换块的能量较弱的部分 i=m~N- l&j=n~N-l的系数中幅值为 1的频域系数置为 0,其中, m〉=0, n〉=l。; 当某个变换块为斜纹理时, 可以将该变换块的能量较弱的部分 i= m+l~N-l&j= m+l ~N- l的系数中幅值为 1的频域系数置为 0, 其中, m〉=2, n>=2;
以 8*8的变换为例:
当某个变换块为水平纹理时, 将该变换块的能量较弱的部分 i=l ~7&j=0~7的系数中幅值为 1的频域系数置为 0;
当某个变换块为垂直纹理时, 将该变换块的能量较弱的部分 i=0~7&j=l~7的系数中幅值为 1的系数置为 0;
当某个变换块为斜纹理时, 将该变换块的能量较弱的部分 i=2~7&j=2~7 的系数中幅值为 1的系数置为 0。
其他纹理, 可以不处理, 也可以按照频域系数能量的分布自适应处理。 其中, 自适应处理的方式例如: 在其他纹理的情况下, 图 lc中每个频域系数 对应的位置编号, 可以表示出频域系数能量的大致分布, 位置编号越小的频
说 明 书
域系数, 能量越高。 因此对于能量越高的频域系数, 处理的较少, 幅值减少 的程度较小,或者不减少;对于因此对于能量越低的频域系数,处理的较多, 幅值减少的程度较大。 例如:
当 i=0~3&j=0~3时, 不处理;
当 i=4~5&j=4~5时, 将幅值为 1的置为 0;
当 i=6~7&j=6~7时, 将幅值为 2的置为 0。
但不仅限于此处理方式, 由于每个频点的能量都不相同, 可以对每个频 点进行不同的处理。
方式二: 减小系数值的幅值。
以 8*8的变换为例:
当某个变换块为水平纹理时, 将该变换块的能量较弱的部分 i=l~7&j=0~7的系数中幅值为 1的系数置为 0, 幅值为 2的系数置为 1 ;
当某个变换块为垂直纹理时, 将该变换块的能量较弱的部分 j=l~7&i=0~7的系数中幅值为 1的系数置为 0, 幅值为 2的系数置为 1 ;
当某个变换块为斜纹理时, 将该变换块的能量较弱的部分 j=2~7&i=2~7 的系数中幅值为 1的系数置为 0, 幅值为 2的系数置为 1。
其他纹理, 可以不处理, 也可以按照频域系数能量的分布自适应处理。 其中, 自适应处理的方式可以参见方式一的相关描述。
上述示例中频域系数或量化系数的幅值多为正值,在频域系数或量化系 数的幅值为幅值的情况下, 可以减小负值的绝对值。例如: 系数的幅值为 -2, 降幅处理, 可以将幅值置为 -1或置为 0等。
此外, 图 Id为本发明实施例一的图像压缩方法所采用的编码器的示意
说 明 书
图, 如图 Id所示, 该编码器(Encoder)可以包括离散余弦变换单元(DCT)、 处理单元 ( Processing )、 量化单元 (Quantizer ) 和熵编码单元 (Entropy encoder )o其中,离散余弦变换单元(DCT)可以对输入图像数据(Input image data)即待处理图像进行 DCT,处理单元可以设置在离散余弦变换单元(DCT) 和量化单元之间, 也可以设置在量化单元和熵编码单元之间, 用于对频域系 数进行降幅处理。 量化单元可以根据量化矩阵 (Quantization table) 中的量 化因子对频域系数进行量化处理。 经过熵编码单元 (Entropy encoder) 可以 得到输出图像数据 ( Output image data)。
本实施例根据待处理图像的纹理方向,对待处理图像的频域系数进行降 幅处理, 在不影响待处理图像的主观质量的同时, 可以提高对待处理图像的 压缩效率。
实施例二
图 2为本发明实施例二的图像压缩方法的流程示意图。 图 2中标号与图 la 相同的组件具有相同的功能, 为简明起见, 省略对这些组件的详细说明。
如图 2所示, 与图 la所示图像压缩方法的主要区别在于在歩骤 101之前, 可以包括:
歩骤 201、 根据所述待处理图像的各个变换块的频域系数, 确定所述变 换块对应的图像内容是否为平坦图像内容;
具体地, 由于噪声属于高频信息, 如果不滤除, 可能严重影响图像的压 缩效率。 但是图像的纹理也属于高频信息, 因此在滤除噪声信息的同时, 也 可能损失很多高频信号。 因此, 本发明实施例在频域对待处理图像进行平坦 图像内容的判断, 滤除平坦图像内容的噪声。 具体地, 可以判断所述变换块
说 明 书
中所有的 AC系数的平方和是否比所述变换块中的 DC系数的平方和与常数的 乘积小, 如果是, 则该变换块对应的图像内容为平坦图像内容, 否则, 该变 换块对应的图像内容为纹理图像内容。 具体可以参见公式 (1 ) :
对于每个变换块, 如果满足公式(1 ), 则该变换块对应的图像内容为平 坦图像内容, 否则, 则该变换块对应的图像内容为纹理图像内容;
在公式( 1 )中, AC为所述变换块中的频域交流系数(可以简称 AC系数), DC为所述变换块中的频域直流系数(可以简称 DC系数), a为常数。 DC系数 表示变换域中的低频成分; AC系数表示变换域的高频成分。 公式(1 ) 的左侧表示每个变换块中所有的 AC系数的平方和, 右侧表示每个变换块中 的 DC系数的平方在乘以常数, 本发明实施例中 a可以取经验值如 0.02。 DCT 是将数据域的待处理图像从时(空)域变换到频域, 参见图 lb, 以对一个图 像进行的 8*8的 DCT为例: 将一个图像划分为多个 8*8的块, 对每个块进行 DCT后可以得到变换块, 每个变换块都包括 8*8个 DCT系数, 相当于一个 8*8 的矩阵, 在频域平面上 DCT变换的系数可以采用二维频域变量 i和 j的函数来 表示, i=0~7, j=0~7。 其中, 变换块中对应于 i=0, j=0频点位置的频域系数 为 DC系数, DC系数也可以称为频域系数的直流分量; 其余 63个频点位置的 频域系数为 AC系数, AC系数也可以称为频域系数的交流分量。
歩骤 202、 对属于所述平坦图像内容的变换块的频域系数或量化系数进 行降幅处理。
具体地, 根据所述待处理图像的各个变换块的频域系数可以在待处理图 像中区分平坦图像内容和纹理图像内容,对属于平坦图像内容的变换块进行
说 明 书
滤波处理, 可以降低属于平坦图像内容的变换块的频域系数的幅值。 例如: 使用高斯频域滤波器对属于平坦图像内容的变换块的频域系数进行处理, 具 体处理方法可以为:
假设对待处理图像采用 8*8的 DCT, 则可以将高斯频域滤波器也设计成 8*8的滤波器, 然后在 8*8的区域内, 将一个变换块的每个频域系数与其相应 位置的滤波器系数相乘, 得到最终处理后的频域系数值。
高斯频域滤波器的强度可以根据图像内容或量化矩阵中的量化因子自 适应调整。 其中, 系数 DC (DCT后左上角的数) 可以不进行处理, 因此 DC 对应的滤波器系数始终为 1。 假设, 取滤波器中用于调整滤波器强度的参数 sigma=6, 滤波器的系数 可以参见公式 (2):
1, 0.986, 0.946, 0.882, 0.801, 0.882, 0.946, 0.986,
0.986, 0.973, 0.933, 0.870, 0.790, 0.870, 0.933, 0.973,
0.946,0.933,0.895,0.835,0.757,0.835,0.895,0.933,
0.882,0.870,0.835,0.779,0.707,0.779,0.835,0.870.
Filter [DCTSIZE] (2)
0.801,0.790,0.757,0.707,0.641,0.707,0.757,0.790, 0.882,0.870,0.835,0.779,0.707,0.779,0.835,0.870.
0.946,0.933,0.895,0.835,0.757,0.835,0.895,0.933,
0.986, 0.973, 0.933, 0.870, 0.790, 0.870, 0.933, 0.973 除此之外, 也可以针对不同的纹理方向, 采用不同强度的滤波器; 或者 可以针对不同的纹理方向, 直接对频域系数或者量化后系数幅值进行调整。
其中, 可以根据纹理方向对一幅待处理图像的频域系数进行降幅处理, 参见实施例一; 也可以根据纹理方向仅对纹理图像内容的频域系数进行降幅 处理, 这样, 歩骤 101具体可以包括:
骤 203、 确定属于纹理图像内容的变换块的纹理方向, 其中, 属于所
说 明 书
述纹理图像内容的变换块为所述待处理图像中不属于所述平坦图像内容的 变换块。
并且, 歩骤 102具体可以包括:
歩骤 204、 根据所述纹理方向, 对属于所述纹理图像内容的变换块对应 的频域系数进行降幅处理。
本实施例根据待处理图像的纹理方向,对待处理图像的变换块对应的频 域系数进行降幅处理, 在不影响待处理图像的主观质量的同时, 可以提高对 待处理图像的压缩效率。
进一歩地, 对待处理图像的平坦图像内容进行滤波处理, 可以滤除平坦 图像内容的噪声,不仅可以在不影响图像主观质量的情况下,增加压缩效率, 降低占用带宽, 并且, 待处理图像也不会损失纹理细节。
实施例三
图 3a为本发明实施例三的图像压缩方法的流程示意图。 图 3a中标号与图 la、 图 2相同的组件具有相同的功能, 为简明起见, 省略对这些组件的详细 说明。
如图 3a所示, 与图 la、 图 2所示图像压缩方法的主要区别在于, 在歩骤 101之前, 还可以包括:
歩骤 301、 对所述待处理图像进行解码, 获得所述待处理图像的解码信 息, 所述解码信息包括所述待处理图像的频域系数、 量化矩阵、 图像分辨率 和图像大小中的至少一项。
具体地,待处理图像可能已经进行过压缩处理,采用 JPEG的标准解码器 可以对已经压缩过的图像进行解码, 可直接获得待处理图像之前解码信息,
说 明 书
解码信息主要可以包括频域系数、量化因子, 以及图像分辨率、图像大小等。 对待处理图像之前编码的信息进行统计分析后, 可以获得再次编码的处理方 式和处理强度; 然后, 对待处理图像再次编码时, 可以采用上述实施例一或 实施例二的图像压缩方法对每个待处理图像进行相应的处理和编码。
歩骤 302、 根据所述待处理图像的所述频域系数、 或根据所述量化矩阵 中的量化因子、 或根据所述图像分辨率和图像大小, 确定所述待处理图像的 压缩强度。
歩骤 303、 根据所述压缩强度, 确定是否需要对所述待处理图像进行压 缩处理, 以及在需要进行压缩处理的情况下确定所述压缩处理的强度。 如果 需要对所述待处理图像进行压缩处理, 再执行歩骤 101或歩骤 201, 否则, 不 执行歩骤 101或歩骤 201。
具体地, 按照不同的解码信息中的一种或多种: 量化矩阵(Qtable)、 频 域系数(coef)、图像分辨率、压缩后的大小,确定压缩强度的具体场景如下; 场景一、 根据量化矩阵 (Qtable) , 确定压缩强度。
其中,采用量化矩阵与变换块左上角的频域系数对应的量化因子判断压 缩强度时时, 以 DC系数对应的量化因子 (QtableO) 确定压缩强度 (level) 为例, 可以采用如下方式:
( 1 ) 当 Qtable0<4时, 压缩强度 level=2;
( 2) 当 4<QtableO<8时, 压缩强度 level=l ;
( 3 ) 当 Qtable0〉8时, 压缩强度 level=0, 即图像压缩已经到极限, 再压 缩就会影响图像的主观质量, 此时, 可以不对待处理图像进行处理。
场景二、 根据频域系数 (coef) 的值, 确定压缩强度。 其中, 频域系数
说 明 书
的个数不限, 例如频域系数可以是 DC系数, 可以是 AC系数, 可以是 DC+AC 系数。
根据指定频点位置的频域系数幅值为 0的个数来判断当前块的内容, 再 确定该块的压缩强度, 从而确定量化因子,
例如, 根据图 lc中的位置, 可以采用如下方式:
( 1 ) 当 20~63位置上的中高频点, 其幅值为 0的个数大于等于 30时, 表 明此图像的为纹理较少, 此时压缩强度可以较强, level=2;
( 2) 当 28~63位置上的中高频点, 其幅值为 0的个数在 15~30之间时, 表 明此图像的为纹理中等, 此时压缩强度可以较弱, level=l ;
( 3 ) 当 28~63位置上的中高频点, 其幅值为 0的个数在 0~15之间时, 表 明此图像的为纹理中等, 此时可不再进行压缩, level=0;
除了以变换块为单位判断压缩强度, 还可以以区域为单位进行判断, 或 者以一副图像为单位进行判断,判断方式可以将每个变换块中指定频点位置 的频域系数幅值为 0的个数累加求平均, 分析得到当前区域或者图像的内容, 在确定压缩强度和量化因子。
场景三、 根据图像分辨率、 压缩后的图像大小, 确定新的压缩强度。 其中, 图像大小和图像分辨率具体表示如下:
图像大小 (byte) =图像宽 *图像长 *位宽 /8;
图像分辨率=图像宽 *图像长;
例 如 : 一 个 1024*768 的 8 位 图 像 , 其 大 小 为 : 1024*768*8/8=786432byte=768KB。
根据图像分辨率和大小, 确定压缩强度的例子可以参见下表 1所示。
说 明 书
上述场景中, 不同的压缩强度可以对应不同的量化矩阵, 强度大的, 量 化矩阵中的量化因子大, 强度小的量化矩阵中的量化因子小; 不同图像的相 同压缩强度, 其量化矩阵可以相同, 也可以不相同; 不同压缩强度, 相同位 置频点的量化因子可以相同, 也可以不同; 并且, 在量化矩阵中, 与 AC系
说 明 书
数对应的量化因子一般大于或等于与 DC系数对应的量化因子。
并且, 上述场景中, 量化矩阵可以根据图像内容自适应变化, 可以多个 图像同一个量化矩阵, 也可以每个图像一个量化矩阵, 每个区域一个量化矩 阵, 每个块一个量化矩阵。 每个量化矩阵可相同也可不同。 并在编码时, 采 用新的量化矩阵对图像进行量化。
此外, 图 3b为本发明实施例三的图像压缩方法所采用的编码器和解码器 的示意图, 如图 3b所示, 解码器(Decoder)可以包括: 熵解码单元(Entropy Decoder), 反量化单元(Dequantizer)、 反离散余弦变换单元(IDCT)、 统计 单元 (Statistics )和基于人眼视觉系统(HVS ) 的分析单元 ( HVS analysis )。 解码器通过熵解码单元 (Entropy Decoder )、 反量化单元 (Dequantizer)、 反 离散余弦变换单元 (IDCT) , 对输入图像数据 (Input image data) 进行解码 后, 得到的重建图像数据 (reconstructed image data) 为待处理图像。 其中, 经过统计单元 (Statistics ) 和基于人眼视觉系统 (HVS ) 的分析单元 (HVS analysis )后, 确定是否对重建图像数据(reconstructed image data)进行压缩 处理。 如果是, 则由编码器(Encoder)对重建图像数据(reconstructed image data)进行压缩处理, 否则可以不对重建图像数据(reconstructed image data) 进行压缩处理。 其中, 编码器可以包括离散余弦变换单元 (DCT)、 处理单 元 ( Processing )、 量化单元 ( Quantizer) 禾口熵编码单元 (Entropy encoder )。 离散余弦变换单元 (DCT) 可以对重建图像数据 (reconstructed image data) 进行 DCT,处理单元可以设置在离散余弦变换单元(DCT)和量化单元之间, 也可以设置在量化单元和熵编码单元之间, 用于对频域系数进行降幅处理。 量化单元可以根据量化矩阵 (Quantization table) 中的量化因子对频域系数
说 明 书
进行量化处理。 经过熵编码单元 (Entropy encoder) 可以得到输出图像数据 ( Output image data )。
本实施例根据待处理图像的纹理方向,对待处理图像的频域系数进行降 幅处理, 在不影响待处理图像的主观质量的同时, 可以提高对待处理图像的 压缩效率。
进一歩地, 对待处理图像的平坦图像内容进行滤波处理, 可以滤除平坦 图像内容的噪声,不仅可以在不影响图像主观质量的情况下,增加压缩效率, 降低占用带宽, 并且, 待处理图像也不会损失纹理细节。
此外, 对于已经压缩过的待处理图像进行解码, 可以预先获取该图像之 前的解码信息, 从而根据该图像的压缩强度确定是否能够进一歩压缩, 更有 利于控制压缩后的主观质量。
实施例四
图 4为本发明实施例四的图像压缩方法的流程示意图。 如图 4所示, 该图 像压缩方法可以包括对待处理图像的频域系数或量化系数进行降幅处理的 歩骤, 所述图像压缩方法具体可以包括:
歩骤 401、 根据待处理图像的各个变换块的频域系数, 确定所述变换块 是否属于平坦图像内容;
具体地, 可以判断所述变换块中所有的 AC系数的平方和是否比所述变 换块中的 DC系数的平方和与常数的乘积小, 如果是, 则该变换块对应的图 像内容为平坦图像内容, 否则, 该变换块对应的图像内容为纹理图像内容。 具体可以参见上述实施例中公式 (1 ) 及其相关描述。
歩骤 402、 对属于所述平坦图像内容的变换块的频域系数或量化系数进
说 明 书
行降幅处理。
具体地, 歩骤 401可以参见实施例二中确定平坦图像内容过程的相关描 述, 歩骤 402可以参见实施例一中降幅处理过程的相关描述。
进一歩地, 在歩骤 401之前还可以包括:
歩骤 501、 对所述待处理图像进行解码, 获得所述待处理图像的解码信 息, 所述解码信息包括所述待处理图像的频域系数、 量化矩阵、 图像分辨率 和图像大小中的至少一项;
歩骤 502、 根据所述待处理图像的所述频域系数、 或根据所述量化矩阵 中量化因子、 或根据所述图像分辨率和图像大小, 确定所述待处理图像的压 缩强度;
歩骤 503、 根据所述压缩强度, 确定是否需要对所述待处理图像进行压 缩处理, 以及在需要进行压缩处理的情况下确定所述压缩处理的强度。
具体地, 歩骤 501到歩骤 503可以参见上述实施例三中确定压缩强度的过 程的相关描述。
本实施例对待处理图像的平坦图像内容进行滤波处理,可以滤除平坦图 像内容的噪声, 不仅可以在不影响图像主观质量的情况下, 增加压缩效率, 降低占用带宽, 并且, 待处理图像也不会损失纹理细节。
此外, 对于已经压缩过的待处理图像进行解码, 可以预先获取该图像之 前的解码信息, 从而根据该图像的压缩强度确定是否能够进一歩压缩, 更有 利于控制压缩后的主观质量。
实施例五
图 5为本发明实施例五的图像压缩装置的结构框图。 如图 5所示, 该图像
说 明 书
压缩装置可以包括:
纹理确定单元 51, 用于确定待处理图像的纹理方向;
降幅处理单元 53, 用于根据所述纹理方向, 对所述待处理图像的频域系 数或量化系数进行降幅处理, 所述频域系数为对图像进行变换后的系数, 所 述量化系数为对所述频域系数进行量化后的系数。
具体地, 纹理确定单元 51可以待处理图像的频域的 AC系数, 确定待处 理图像的纹理方向。 其中, 对待处理图像进行频域变换如 DCT后, 可以得到 各个变换块的频域系数, 然后根据频域系数可以确定待处理图像的纹理方 向。具体地频域变换和确定纹理方向的解释与示例可以参见实施例一的相关 描述, 在此不再赘述。
然后, 降幅处理单元 53可以根据纹理方向, 对待处理图像的频域系数或 量化系数进行降幅处理。 其中, 量化系数为根据量化矩阵对频域系数进行量 化的系数, 具体的量化矩阵和降幅处理的解释与示例可以参见实施例一的相 关描述, 在此不再赘述。
本实施例图像压缩装置, 根据待处理图像的纹理方向, 对待处理图像的 频域系数进行降幅处理, 在不影响待处理图像的主观质量的同时, 可以提高 对待处理图像的压缩效率。
实施例六
图 6为本发明实施例六的图像压缩装置的结构框图。 图 6中标号与图 5相 同的组件具有相同的功能, 为简明起见, 省略对这些组件的详细说明。
如图 6所示, 该图像压缩装置的降幅处理单元 53具体可以用于根据所述 纹理方向, 获取所述频域系数或量化系数能量集中区域和非能量集中区域,
说 明 书
所述能量集中区域比所述非能量集中区域的频域系数幅值之和或量化系数 幅值之和大;对所述非能量集中区域中的一个或多个频域系数或量化系数进 行降幅处理。 其中, 能量集中区域和非能量集中区域的具体解释与示例可以 参见实施例一的相关描述, 在此不再赘述。
在一种可能的实现方式中, 该图像压缩装置还可以包括:
平坦确定单元 61, 用于根据所述待处理图像的各个变换块的频域系数, 确定所述变换块对应的图像内容是否为平坦图像内容,所述变换块为从所述 待处理图像中预先划分的进行频域变换的块; 其中, 确定平图像内容的具体 解释与示例可以参见实施例二的相关描述, 在此不再赘述。
所述降幅处理单元 53,还用于对属于所述平坦图像内容的变换块的频域 系数或量化系数进行降幅处理。
在一种可能的实现方式中,所述纹理确定单元 51还可以用于确定属于纹 理图像内容的变换块的纹理方向, 其中, 属于所述纹理图像内容的变换块为 所述待处理图像中不属于所述平坦图像内容的变换块;
所述降幅处理单元 53还用于根据所述纹理方向,对属于所述纹理图像内 容的变换块对应的频域系数或量化系数进行降幅处理。
在一种可能的实现方式中, 该图像压缩装置还可以包括:
解码单元 65, 用于对所述待处理图像进行解码, 获得所述待处理图像的 解码信息, 所述解码信息包括所述待处理图像的频域系数、 量化矩阵、 图像 分辨率和图像大小中的至少一项;
统计分析单元 67, 用于根据所述待处理图像的所述频域系数、 或根据所 述量化矩阵中的量化因子、 或根据所述图像分辨率和图像大小, 确定所述待
说 明 书
处理图像的压缩强度; 根据所述压缩强度, 确定是否需要对所述待处理图像 进行压缩处理, 以及在需要进行压缩处理的情况下确定所述压缩处理的强 度。
其中, 解码单元 65可以对经进行过压缩处理的待处理图像进行解码, 由 统计分析单元 67根据解码信息确定压缩强度, 从而确定是否需要进一歩压 缩, 具体过程可以参见实施例三的相关描述和图 3b, 在此不再赘述。
所述频域系数可以包括直流 DC系数和交流 AC系数, 在一种可能的实现 方式中,所述纹理确定单元 51具体可以用于根据所述图像中的变换块的频域 AC系数, 确定变换块对应的待处理图像的纹理方向。
在一种可能的实现方式中, 所述平坦确定单元 61具体可以用于: 判断所 述变换块中所有的 AC系数的平方和是否比所述变换块中的 DC系数的平方和 与常数的乘积小; 如果是, 则所述变换块对应的图像内容为平坦图像内容, 否则, 所述变换块对应的图像内容为纹理图像内容。 具体可以参见上述图像 压缩方法实施例中的公式 (2) 及其相关描述。
本实施例图像压缩装置, 根据待处理图像的纹理方向, 对待处理图像的 频域系数进行降幅处理, 在不影响待处理图像的主观质量的同时, 可以提高 对待处理图像的压缩效率。
进一歩地, 对待处理图像的平坦图像内容进行滤波处理, 可以滤除平坦 图像内容的噪声,不仅可以在不影响图像主观质量的情况下,增加压缩效率, 降低占用带宽, 并且, 待处理图像也不会损失纹理细节。
此外, 对于已经压缩过的待处理图像进行解码, 可以预先获取该图像之 前的解码信息, 从而根据该图像的压缩强度确定是否能够进一歩压缩, 更有
说 明 书
利于控制压缩后的主观质量。
实施例七
图 7为本发明实施例七的图像压缩装置的结构框图。 如图 7所示, 该图像 压缩装置可以包括:
平坦确定单元 71, 用于根据待处理图像的各个变换块的频域系数, 确定 所述变换块对应的图像内容是否为平坦图像内容,所述变换块为从所述待处 理图像中预先划分的进行频域变换的块;
降幅处理单元 73,用于对属于所述平坦图像内容的变换块的频域系数或 量化系数进行降幅处理。
其中, 确定平图像内容的具体解释与示例可以参见实施例二的相关描 述, 在此不再赘述。
在一种可能的实现方式中, 该图像压缩装置还可以包括:
解码单元 75, 用于对所述待处理图像进行解码, 获得所述待处理图像的 解码信息, 所述解码信息包括所述待处理图像的频域系数、 量化矩阵、 图像 分辨率和图像大小中的至少一项;
统计分析单元 77, 用于根据所述待处理图像的所述频域系数、 或根据所 述量化矩阵中的量化因子、 或根据所述图像分辨率和图像大小, 确定所述待 处理图像的压缩强度; 根据所述压缩强度, 确定是否需要对所述待处理图像 进行压缩处理, 以及在需要进行压缩处理的情况下确定所述压缩处理的强 度。
其中, 解码单元 75可以对经进行过压缩处理的待处理图像进行解码, 由 统计分析单元 77根据解码信息确定压缩强度, 从而确定是否需要进一歩压
说 明 书
缩, 具体过程可以参见实施例三的相关描述和图 3b, 在此不再赘述。
在一种可能的实现方式中, 所述平坦确定单元具体可以用于: 判断所述 变换块中所有的 AC系数的平方和是否比所述变换块中的 DC系数的平方和与 常数的乘积小; 如果是, 则所述变换块对应的图像内容为平坦图像内容, 否 则, 所述变换块对应的图像内容为纹理图像内容。 具体可以参见上述图像压 缩方法实施例中的公式 (2) 及其相关描述。
本实施例图像压缩装置, 对待处理图像的平坦图像内容进行滤波处理, 可以滤除平坦图像内容的噪声, 不仅可以在不影响图像主观质量的情况下, 增加对待处理图像的压缩效率, 降低占用带宽, 并且, 待处理图像也不会损 失纹理细节。
此外, 对于已经压缩过的待处理图像进行解码, 可以预先获取该图像之 前的解码信息, 从而根据该图像的压缩强度确定是否能够进一歩压缩, 更有 利于控制压缩后的主观质量。
实施例八
图 8为本发明实施例八的图像压缩装置的结构框图。 所述图像压缩装置 1100可以是具备计算能力的主机服务器、个人计算机 PC、或者可携带的便携 式计算机或终端等。 本发明具体实施例并不对计算节点的具体实现做限定。
所述图像压缩装置 1100包括处理器(processor)lllO、 通信接口 (Communications Interface) 1120 ,存储器 (memory) 1130和总线 1140。 其中, 处 理器 1110、通信接口 1120、以及存储器 1130通过总线 1140完成相互间的通信。
通信接口 1120用于与网络设备通信, 其中网络设备包括例如虚拟机管理 中心、 共享存储等。
说 明 书
处理器 1110用于执行程序。 处理器 1110可能是一个中央处理器 CPU, 或 者是专用集成电路 ASIC (Application Specific Integrated Circuit) , 或者是被 配置成实施本发明实施例的一个或多个集成电路。
存储器 1130用于存放程序和数据。 存储器 1130可能包含高速 RAM存储 器, 也可能还包括非易失性存储器 (non-volatile memory), 例如至少一个磁盘 存储器。 存储器 1130也可以是存储器阵列。 存储器 1130还可能被分块, 并且 所述块可按一定的规则组合成虚拟卷。
在一种可能的实施方式中, 上述程序可为包括计算机操作指令的程序代 码。 该程序具体可用于执行一种图像压缩方法, 包括对待处理图像的频域系 数或量化系数进行降幅处理的歩骤, 所述图像压缩方法包括:
确定待处理图像的纹理方向;
根据所述纹理方向,对所述待处理图像的频域系数或量化系数进行降幅 处理, 所述频域系数为对图像进行变换后的系数, 所述量化系数为对所述频 域系数进行量化后的系数。
在一种可能的实现方式中, 根据所述纹理方向, 对所述待处理图像的频 域系数或量化系数进行降幅处理, 包括:
根据所述纹理方向, 获取所述频域系数或量化系数能量集中区域和非能 量集中区域,所述能量集中区域比所述非能量集中区域的频域系数幅值之和 或量化系数幅值之和大;
对所述非能量集中区域中的一个或多个频域系数或量化系数进行降幅 处理。
在一种可能的实现方式中, 所述确定待处理图像的纹理方向之前, 还包
说 明 书
括:
根据所述待处理图像的各个变换块的频域系数, 确定所述变换块对应的 图像内容是否为平坦图像内容,所述变换块为从所述待处理图像中预先划分 的进行频域变换的块;
对属于所述平坦图像内容的变换块的频域系数或量化系数进行降幅处 理。
在一种可能的实现方式中, 所述确定待处理图像的纹理方向, 包括: 确 定属于纹理图像内容的变换块的纹理方向, 其中, 属于所述纹理图像内容的 变换块为所述待处理图像中不属于所述平坦图像内容的变换块;
根据所述纹理方向,对所述待处理图像的频域系数或量化系数进行降幅 处理, 包括: 根据所述纹理方向, 对属于所述纹理图像内容的变换块对应的 频域系数或量化系数进行降幅处理。
在一种可能的实现方式中, 确定待处理图像的纹理方向之前, 还包括: 对所述待处理图像进行解码, 获得所述待处理图像的解码信息, 所述解 码信息包括所述待处理图像的频域系数、 量化矩阵、 图像分辨率和图像大小 中的至少一项; 根据所述待处理图像的所述频域系数、或根据所述量化矩阵中的量化因 子、 或根据所述图像分辨率和图像大小, 确定所述待处理图像的压缩强度; 根据所述压缩强度, 确定是否需要对所述待处理图像进行压缩处理, 以 及在需要进行压缩处理的情况下确定所述压缩处理的强度。
在一种可能的实现方式中, 所述频域系数包括直流 DC系数和交流 AC系 数, 所述确定待处理图像的纹理方向, 包括:
说 明 书
根据所述图像中的变换块的频域 AC系数, 确定变换块对应的待处理图 像的纹理方向。
在一种可能的实现方式中, 所述频域系数包括直流 DC系数和交流 AC系 数, 所述根据所述待处理图像的各个变换块的频域系数, 确定所述变换块对 应的图像内容是否为平坦图像内容, 包括:
判断所述变换块中所有的 AC系数的平方和是否比所述变换块中的 DC系 数的平方和与常数的乘积小;
如果是, 则所述变换块对应的图像内容为平坦图像内容, 否则, 所述变 换块对应的图像内容为纹理图像内容。
进一歩地, 该程序具体还可用于执行一种图像压缩方法, 包括对待处理 图像的频域系数或量化系数进行降幅处理的歩骤, 所述图像压缩方法包括: 根据待处理图像的各个变换块的频域系数,确定所述变换块对应的图像 内容是否为平坦图像内容,所述变换块为从所述待处理图像中预先划分的进 行频域变换的块;
对属于所述平坦图像内容的变换块的频域系数或量化系数进行降幅处 理。
在一种可能的实现方式中, 根据待处理图像的各个变换块的频域系数, 确定所述变换块对应的图像内容是否为平坦图像内容之前, 还包括:
对所述待处理图像进行解码, 获得所述待处理图像的解码信息, 所述解 码信息包括所述待处理图像的频域系数、 量化矩阵、 图像分辨率和图像大小 中的至少一项; 根据所述待处理图像的所述频域系数、 或根据所述量化矩阵中量化因
说 明 书
子、 或根据所述图像分辨率和图像大小, 确定所述待处理图像的压缩强度; 根据所述压缩强度, 确定是否需要对所述待处理图像进行压缩处理, 以 及在需要进行压缩处理的情况下确定所述压缩处理的强度。
在一种可能的实现方式中, 所述频域系数包括直流 DC系数和交流 AC系 数, 所述根据所述待处理图像的各个变换块的频域系数, 确定所述变换块对 应的图像内容是否为平坦图像内容, 包括:
判断所述变换块中所有的 AC系数的平方和是否比所述变换块中的 DC系 数的平方和与常数的乘积小;
如果是, 则所述变换块对应的图像内容为平坦图像内容, 否则, 则所述 变换块对应的图像内容为纹理图像内容。
本实施例根据待处理图像的纹理方向,对待处理图像的频域系数进行降 幅处理, 在不影响待处理图像的主观质量的同时, 可以提高对待处理图像的 压缩效率。
进一歩地, 对待处理图像的平坦图像内容进行滤波处理, 可以滤除平坦 图像内容的噪声,不仅可以在不影响图像主观质量的情况下,增加压缩效率, 降低占用带宽, 并且, 待处理图像也不会损失纹理细节。
此外, 对于已经压缩过的待处理图像进行解码, 可以预先获取该图像之 前的解码信息, 从而根据该图像的压缩强度确定是否能够进一歩压缩, 更有 利于控制压缩后的主观质量。
本领域普通技术人员可以意识到, 本文所描述的实施例中的各示例性单 元及算法歩骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。 这些功能究竟以硬件还是软件形式来实现, 取决于技术方案的特定应用和设
说 明 书
计约束条件。专业技术人员可以针对特定的应用选择不同的方法来实现所描 述的功能, 但是这种实现不应认为超出本发明的范围。
如果以计算机软件的形式来实现所述功能并作为独立的产品销售或使 用时, 则在一定程度上可认为本发明的技术方案的全部或部分(例如对现有 技术做出贡献的部分)是以计算机软件产品的形式体现的。 该计算机软件产 品通常存储在计算机可读取的非易失性存储介质中,包括若干指令用以使得 计算机设备 (可以是个人计算机、 服务器、 或者网络设备等)执行本发明各 实施例方法的全部或部分歩骤。 而前述的存储介质包括 U盘、 移动硬盘、 只 读存储器 (ROM, Read-Only Memory )、 随机存取存储器 (RAM, Random Access Memory), 磁碟或者光盘等各种可以存储程序代码的介质。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护 范围应以所述权利要求的保护范围为准。
Claims
1、 一种图像压缩方法, 其特征在于, 包括对待处理图像的频域系数或 量化系数进行降幅处理的歩骤, 所述图像压缩方法包括:
确定待处理图像的纹理方向;
根据所述纹理方向,对所述待处理图像的频域系数或量化系数进行降幅 处理, 所述频域系数为对图像进行变换后的系数, 所述量化系数为对所述频 域系数进行量化后的系数。
2、 根据权利要求 1所述的图像压缩方法, 其特征在于, 根据所述纹理方 向, 对所述待处理图像的频域系数或量化系数进行降幅处理, 包括:
根据所述纹理方向, 获取所述频域系数或量化系数能量集中区域和非能 量集中区域,所述能量集中区域比所述非能量集中区域的频域系数幅值之和 或量化系数幅值之和大;
对所述非能量集中区域中的一个或多个频域系数或量化系数进行降幅 处理。
3、 根据权利要求 1或 2所述的图像压缩方法, 其特征在于, 所述确定待 处理图像的纹理方向之前, 还包括:
根据所述待处理图像的各个变换块的频域系数, 确定所述变换块对应的 图像内容是否为平坦图像内容,所述变换块为从所述待处理图像中预先划分 的进行频域变换的块;
对属于所述平坦图像内容的变换块的频域系数或量化系数进行降幅处 理。
4、 根据权利要求 3所述的图像压缩方法, 其特征在于, 所述确定待处理 图像的纹理方向,包括:确定属于纹理图像内容的变换块的纹理方向,其中,
权 利 要 求 书
属于所述纹理图像内容的变换块为所述待处理图像中不属于所述平坦图像 内容的变换块;
根据所述纹理方向,对所述待处理图像的频域系数或量化系数进行降幅 处理, 包括: 根据所述纹理方向, 对属于所述纹理图像内容的变换块对应的 频域系数或量化系数进行降幅处理。
5、 根据权利要求 1-4中任一项所述的图像压缩方法, 其特征在于, 确定 待处理图像的纹理方向之前, 还包括:
对所述待处理图像进行解码, 获得所述待处理图像的解码信息, 所述解 码信息包括所述待处理图像的频域系数、 量化矩阵、 图像分辨率和图像大小 中的至少一项; 根据所述待处理图像的所述频域系数、或根据所述量化矩阵中的量化因 子、 或根据所述图像分辨率和图像大小, 确定所述待处理图像的压缩强度; 根据所述压缩强度, 确定是否需要对所述待处理图像进行压缩处理, 以 及在需要进行压缩处理的情况下确定所述压缩处理的强度。
6、 根据权利要求 1-5中任一项所述的图像压缩方法, 其特征在于, 所述 频域系数包括直流 DC系数和交流 AC系数,所述确定待处理图像的纹理方向, 包括:
根据所述图像中的变换块的频域 AC系数, 确定变换块对应的待处理图 像的纹理方向。
7、 根据权利要求 3或 4所述的图像压缩方法, 其特征在于, 所述频域系数 包括直流 DC系数和交流 AC系数, 所述根据所述待处理图像的各个变换块的 频域系数, 确定所述变换块对应的图像内容是否为平坦图像内容, 包括:
权 利 要 求 书
判断所述变换块中所有的 AC系数的平方和是否比所述变换块中的 DC系 数的平方和与常数的乘积小;
如果是, 则所述变换块对应的图像内容为平坦图像内容, 否则, 所述变 换块对应的图像内容为纹理图像内容。
8、 一种图像压缩方法, 其特征在于, 包括对待处理图像的频域系数或 量化系数进行降幅处理的歩骤, 所述图像压缩方法包括:
根据待处理图像的各个变换块的频域系数,确定所述变换块对应的图像 内容是否为平坦图像内容,所述变换块为从所述待处理图像中预先划分的进 行频域变换的块;
对属于所述平坦图像内容的变换块的频域系数或量化系数进行降幅处 理。
9、 根据权利要求 8所述的图像压缩方法, 其特征在于, 根据待处理图像 的各个变换块的频域系数, 确定所述变换块对应的图像内容是否为平坦图像 内容之前, 还包括:
对所述待处理图像进行解码, 获得所述待处理图像的解码信息, 所述解 码信息包括所述待处理图像的频域系数、 量化矩阵、 图像分辨率和图像大小 中的至少一项; 根据所述待处理图像的所述频域系数、 或根据所述量化矩阵中量化因 子、 或根据所述图像分辨率和图像大小, 确定所述待处理图像的压缩强度; 根据所述压缩强度, 确定是否需要对所述待处理图像进行压缩处理, 以 及在需要进行压缩处理的情况下确定所述压缩处理的强度。
10、 根据权利要求 8或 9所述的图像压缩方法, 其特征在于, 所述频域系
权 利 要 求 书
数包括直流 DC系数和交流 AC系数, 所述根据所述待处理图像的各个变换块 的频域系数, 确定所述变换块对应的图像内容是否为平坦图像内容, 包括: 判断所述变换块中所有的 AC系数的平方和是否比所述变换块中的 DC系 数的平方和与常数的乘积小;
如果是, 则所述变换块对应的图像内容为平坦图像内容, 否则, 则所述 变换块对应的图像内容为纹理图像内容。
11、 一种图像压缩装置, 其特征在于, 包括:
纹理确定单元, 用于确定待处理图像的纹理方向;
降幅处理单元, 用于根据所述纹理方向, 对所述待处理图像的频域系数 或量化系数进行降幅处理, 所述频域系数为对图像进行变换后的系数, 所述 量化系数为对所述频域系数进行量化后的系数。
12、 根据权利要求 11所述的图像压缩装置, 其特征在于, 所述降幅处理 单元具体用于根据所述纹理方向, 获取所述频域系数或量化系数能量集中区 域和非能量集中区域,所述能量集中区域比所述非能量集中区域的频域系数 幅值之和或量化系数幅值之和大; 对所述非能量集中区域中的一个或多个频 域系数或量化系数进行降幅处理。
13、 根据权利要求 11或 12所述的图像压缩装置, 其特征在于, 还包括: 平坦确定单元, 用于根据所述待处理图像的各个变换块的频域系数, 确 定所述变换块对应的图像内容是否为平坦图像内容,所述变换块为从所述待 处理图像中预先划分的进行频域变换的块;
所述降幅处理单元, 还用于对属于所述平坦图像内容的变换块的频域系 数或量化系数进行降幅处理。
权 利 要 求 书
14、 根据权利要求 13所述的图像压缩装置, 其特征在于, 所述纹理确定 单元还用于确定属于纹理图像内容的变换块的纹理方向, 其中, 属于所述纹 理图像内容的变换块为所述待处理图像中不属于所述平坦图像内容的变换 块;
所述降幅处理单元还用于根据所述纹理方向,对属于所述纹理图像内容 的变换块对应的频域系数或量化系数进行降幅处理。
15、根据权利要求 11-14中任一项所述的图像压缩装置, 其特征在于, 还 包括:
解码单元, 用于对所述待处理图像进行解码, 获得所述待处理图像的解 码信息, 所述解码信息包括所述待处理图像的频域系数、 量化矩阵、 图像分 辨率和图像大小中的至少一项;
统计分析单元, 用于根据所述待处理图像的所述频域系数、 或根据所述 量化矩阵中的量化因子、 或根据所述图像分辨率和图像大小, 确定所述待处 理图像的压缩强度; 根据所述压缩强度, 确定是否需要对所述待处理图像进 行压缩处理, 以及在需要进行压缩处理的情况下确定所述压缩处理的强度。
16、根据权利要求 11-15中任一项所述的图像压缩装置, 其特征在于, 所 述频域系数包括直流 DC系数和交流 AC系数, 所述纹理确定单元具体用于根 据所述图像中的变换块的频域 AC系数, 确定变换块对应的待处理图像的纹 理方向。
17、 根据权利要求 13或 14所述的图像压缩装置, 其特征在于, 所述频域 系数包括直流 DC系数和交流 AC系数, 所述平坦确定单元具体用于: 判断所 述变换块中所有的 AC系数的平方和是否比所述变换块中的 DC系数的平方和
权 利 要 求 书
与常数的乘积小; 如果是, 则所述变换块对应的图像内容为平坦图像内容, 否则, 所述变换块对应的图像内容为纹理图像内容。
18、 一种图像压缩装置, 其特征在于, 包括:
平坦确定单元, 用于根据待处理图像的各个变换块的频域系数, 确定所 述变换块对应的图像内容是否为平坦图像内容,所述变换块为从所述待处理 图像中预先划分的进行频域变换的块;
降幅处理单元,用于对属于所述平坦图像内容的变换块的频域系数或量 化系数进行降幅处理。
19、 根据权利要求 18所述的图像压缩装置, 其特征在于, 还包括: 解码单元, 用于对所述待处理图像进行解码, 获得所述待处理图像的解 码信息, 所述解码信息包括所述待处理图像的频域系数、 量化矩阵、 图像分 辨率和图像大小中的至少一项;
统计分析单元, 用于根据所述待处理图像的所述频域系数、 或根据所述 量化矩阵中的量化因子、 或根据所述图像分辨率和图像大小, 确定所述待处 理图像的压缩强度; 根据所述压缩强度, 确定是否需要对所述待处理图像进 行压缩处理, 以及在需要进行压缩处理的情况下确定所述压缩处理的强度。
20、 根据权利要求 18或 19所述的图像压缩装置, 其特征在于, 所述平坦 确定单元具体用于: 判断所述变换块中所有的 AC系数的平方和是否比所述 变换块中的 DC系数的平方和与常数的乘积小; 如果是, 则所述变换块对应 的图像内容为平坦图像内容, 否则, 所述变换块对应的图像内容为纹理图像 内容。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP14866761.1A EP3068134B1 (en) | 2013-11-29 | 2014-04-11 | Method and device for image compression |
US15/165,517 US9888245B2 (en) | 2013-11-29 | 2016-05-26 | Image compression method and apparatus for performing amplitude decreasing processing |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310631742.X | 2013-11-29 | ||
CN201310631742.XA CN104683801B (zh) | 2013-11-29 | 2013-11-29 | 图像压缩方法和装置 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US15/165,517 Continuation US9888245B2 (en) | 2013-11-29 | 2016-05-26 | Image compression method and apparatus for performing amplitude decreasing processing |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2015078131A1 true WO2015078131A1 (zh) | 2015-06-04 |
Family
ID=53198280
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2014/075196 WO2015078131A1 (zh) | 2013-11-29 | 2014-04-11 | 图像压缩方法和装置 |
Country Status (4)
Country | Link |
---|---|
US (1) | US9888245B2 (zh) |
EP (1) | EP3068134B1 (zh) |
CN (1) | CN104683801B (zh) |
WO (1) | WO2015078131A1 (zh) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104683801B (zh) * | 2013-11-29 | 2018-06-05 | 华为技术有限公司 | 图像压缩方法和装置 |
US10999602B2 (en) | 2016-12-23 | 2021-05-04 | Apple Inc. | Sphere projected motion estimation/compensation and mode decision |
US11259046B2 (en) | 2017-02-15 | 2022-02-22 | Apple Inc. | Processing of equirectangular object data to compensate for distortion by spherical projections |
US10924747B2 (en) | 2017-02-27 | 2021-02-16 | Apple Inc. | Video coding techniques for multi-view video |
US11093752B2 (en) | 2017-06-02 | 2021-08-17 | Apple Inc. | Object tracking in multi-view video |
US10754242B2 (en) | 2017-06-30 | 2020-08-25 | Apple Inc. | Adaptive resolution and projection format in multi-direction video |
US11477492B2 (en) * | 2017-08-04 | 2022-10-18 | Google Inc. | Adaptation for entropy coding of blocks of image data |
CN108156457B (zh) * | 2017-12-27 | 2021-10-15 | 郑州云海信息技术有限公司 | 一种JPEG转WebP的图像编码方法及装置 |
CN111225216A (zh) * | 2020-01-10 | 2020-06-02 | Tcl华星光电技术有限公司 | 显示器补偿表压缩方法、装置、系统及显示器 |
CN111654701B (zh) * | 2020-04-21 | 2022-02-11 | 北京奇艺世纪科技有限公司 | 视频编码预处理方法、装置、设备和计算机可读存储介质 |
CN116325752A (zh) * | 2020-09-29 | 2023-06-23 | 华为技术有限公司 | 一种图像压缩方法及装置 |
CN114786014A (zh) * | 2022-02-28 | 2022-07-22 | 北京邮电大学 | 一种视频压缩方法及装置 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101996411A (zh) * | 2009-08-21 | 2011-03-30 | 中国人民解放军国防科学技术大学 | 一种用于图像压缩的快速方向小波变换方法 |
CN102316324A (zh) * | 2011-08-24 | 2012-01-11 | 北京航空航天大学 | 一种基于局部最小熵的图像编码预测方法 |
CN102611831A (zh) * | 2012-01-12 | 2012-07-25 | 陆许明 | 降低压缩图像编码噪声的方法 |
CN103024377A (zh) * | 2012-11-27 | 2013-04-03 | 西安电子科技大学 | 基于目标区域提取与方向波的sar图像压缩方法 |
CN103366366A (zh) * | 2013-06-19 | 2013-10-23 | 海南大学 | 一种基于dft压缩域的智能纹理防伪方法 |
Family Cites Families (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6285798B1 (en) * | 1998-07-06 | 2001-09-04 | Eastman Kodak Company | Automatic tone adjustment by contrast gain-control on edges |
SG75189A1 (en) * | 1998-12-04 | 2000-09-19 | Canon Kk | Image processing apparatus method therefor and recording medium storing image processing program |
JP2000209580A (ja) * | 1999-01-13 | 2000-07-28 | Canon Inc | 画像処理装置およびその方法 |
FI107495B (fi) * | 1999-08-13 | 2001-08-15 | Nokia Multimedia Network Termi | Menetelmä ja järjestely koodatun digitaalisen kuvabittivirran volyymin tai tahdin pienentämiseksi |
JP4254017B2 (ja) * | 2000-03-10 | 2009-04-15 | ソニー株式会社 | 画像符号化装置及び方法 |
KR100584552B1 (ko) * | 2003-01-14 | 2006-05-30 | 삼성전자주식회사 | 동영상 부호화 및 복호화 방법과 그 장치 |
JP2006519565A (ja) | 2003-03-03 | 2006-08-24 | コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ | ビデオ符号化 |
KR100606140B1 (ko) * | 2004-11-09 | 2006-08-01 | (주)씨앤에스 테크놀로지 | 적응적 모드 결정에 의한 움직임 예측방법 |
EP1720356A1 (en) * | 2005-05-03 | 2006-11-08 | Matsushita Electric Industrial Co., Ltd. | A frequency selective video compression |
CN101527800B (zh) * | 2009-03-31 | 2011-01-05 | 西安交通大学 | 一种获取基于h.264/avc压缩视频字幕的方法 |
WO2011042898A1 (en) | 2009-10-05 | 2011-04-14 | I.C.V.T Ltd. | Apparatus and methods for recompression of digital images |
US9467705B2 (en) * | 2009-12-30 | 2016-10-11 | Ariscale Inc. | Video encoding apparatus, video decoding apparatus, and video decoding method for performing intra-prediction based on directionality of neighboring block |
CN102202217A (zh) * | 2010-03-22 | 2011-09-28 | 北京中星微电子有限公司 | 一种jpeg编码方法和设备 |
JP5887715B2 (ja) * | 2011-05-23 | 2016-03-16 | セイコーエプソン株式会社 | 画像処理装置および画像処理方法 |
JP2013038758A (ja) * | 2011-07-13 | 2013-02-21 | Canon Inc | 画像符号化装置、画像符号化方法及びプログラム、画像復号装置、画像復号方法及びプログラム |
CN104683801B (zh) * | 2013-11-29 | 2018-06-05 | 华为技术有限公司 | 图像压缩方法和装置 |
-
2013
- 2013-11-29 CN CN201310631742.XA patent/CN104683801B/zh active Active
-
2014
- 2014-04-11 WO PCT/CN2014/075196 patent/WO2015078131A1/zh active Application Filing
- 2014-04-11 EP EP14866761.1A patent/EP3068134B1/en active Active
-
2016
- 2016-05-26 US US15/165,517 patent/US9888245B2/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101996411A (zh) * | 2009-08-21 | 2011-03-30 | 中国人民解放军国防科学技术大学 | 一种用于图像压缩的快速方向小波变换方法 |
CN102316324A (zh) * | 2011-08-24 | 2012-01-11 | 北京航空航天大学 | 一种基于局部最小熵的图像编码预测方法 |
CN102611831A (zh) * | 2012-01-12 | 2012-07-25 | 陆许明 | 降低压缩图像编码噪声的方法 |
CN103024377A (zh) * | 2012-11-27 | 2013-04-03 | 西安电子科技大学 | 基于目标区域提取与方向波的sar图像压缩方法 |
CN103366366A (zh) * | 2013-06-19 | 2013-10-23 | 海南大学 | 一种基于dft压缩域的智能纹理防伪方法 |
Non-Patent Citations (1)
Title |
---|
See also references of EP3068134A4 * |
Also Published As
Publication number | Publication date |
---|---|
US20160277746A1 (en) | 2016-09-22 |
US9888245B2 (en) | 2018-02-06 |
CN104683801B (zh) | 2018-06-05 |
EP3068134B1 (en) | 2021-06-09 |
EP3068134A4 (en) | 2017-02-22 |
EP3068134A1 (en) | 2016-09-14 |
CN104683801A (zh) | 2015-06-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2015078131A1 (zh) | 图像压缩方法和装置 | |
Zhang et al. | CONCOLOR: Constrained non-convex low-rank model for image deblocking | |
US10469876B2 (en) | Non-local adaptive loop filter combining multiple denoising technologies and grouping image patches in parallel | |
Liu et al. | Data-driven soft decoding of compressed images in dual transform-pixel domain | |
CN106170093B (zh) | 一种帧内预测性能提升编码方法 | |
US20100080472A1 (en) | Image processing apparatus, moving image decoding apparatus, moving image encoding apparatus and method | |
CN104378636B (zh) | 一种视频图像编码方法及装置 | |
JP2011510591A (ja) | 時空間的複雑度を用いた符号化モード決定方法及び装置 | |
WO2002096118A2 (en) | Decoding compressed image data | |
AU2019298855B2 (en) | Apparatus and method for filtering in video coding | |
WO2013056129A1 (en) | Region-based image compression | |
Zhang et al. | Reducing blocking artifacts in compressed images via transform-domain non-local coefficients estimation | |
WO2006133613A1 (en) | Method for reducing image block effects | |
CN112165620B (zh) | 视频的编码方法及装置、存储介质、电子设备 | |
Zhu et al. | Compression-dependent transform-domain downward conversion for block-based image coding | |
Zhang et al. | Image deblocking using group-based sparse representation and quantization constraint prior | |
JP2003018600A (ja) | 画像復号装置 | |
CN108900842B (zh) | Y数据压缩处理方法、装置、设备及WebP压缩系统 | |
WO2012118569A1 (en) | Visually optimized quantization | |
CN103442235B (zh) | 一种图像处理方法以及装置 | |
CN107172425B (zh) | 缩略图生成方法、装置及终端设备 | |
US8768089B2 (en) | System and method for filtering an image | |
CN102202217A (zh) | 一种jpeg编码方法和设备 | |
Zhang et al. | Color image compression based on directional all phase biorthogonal transform | |
JP2003304537A (ja) | 低ビットレートの適用のためのディジタル画像処理方法 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 14866761 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
REEP | Request for entry into the european phase |
Ref document number: 2014866761 Country of ref document: EP |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2014866761 Country of ref document: EP |