CN100539700C - Method for encoding images and device - Google Patents

Method for encoding images and device Download PDF

Info

Publication number
CN100539700C
CN100539700C CN 200810105766 CN200810105766A CN100539700C CN 100539700 C CN100539700 C CN 100539700C CN 200810105766 CN200810105766 CN 200810105766 CN 200810105766 A CN200810105766 A CN 200810105766A CN 100539700 C CN100539700 C CN 100539700C
Authority
CN
China
Prior art keywords
abandons
resolution
high frequency
original image
dct coefficient
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN 200810105766
Other languages
Chinese (zh)
Other versions
CN101267566A (en
Inventor
孟新建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN 200810105766 priority Critical patent/CN100539700C/en
Publication of CN101267566A publication Critical patent/CN101267566A/en
Application granted granted Critical
Publication of CN100539700C publication Critical patent/CN100539700C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention relates to a kind of method for encoding images and device, and this method comprises: read the compressed bit stream of original image, the compressed bit stream of described original image is resolved, obtain the resolution of described original image; To carry out entropy decoding, counter-scanning through the compressed bit stream of resolving, obtain original dct coefficient matrix; According to the relation between the resolution of the resolution of described original image and display unit, determine the pattern that abandons of high frequency discrete cosine transform coefficient; Abandon corresponding high frequency discrete cosine transform coefficient according to the described pattern that abandons; Scan abandoning new dct coefficient matrix behind the high frequency discrete cosine transform coefficient, entropy coding, form the conversion code stream of compression, thereby saved memory space, reduced the picture decoding computational complexity, reduced cost and power consumption.

Description

Method for encoding images and device
Technical field
The present invention relates to the image coding and decoding field, especially a kind of method for encoding images and device.
Background technology
Development along with multimedia communication technology, people no longer satisfy the transmission of single literal or sound, from the plain old telephone to the visual telephone, from short message (Short Messaging Service, SMS) to enhanced short message (Enhanced Message Service, EMS) (MultimediaMessaging Service, MMS), multimedia technology progresses into huge numbers of families to arrive multimedia short message again.Therefore, how research handles multimedia source efficiently, allows its more convenient stores effectively and transmission is very important.(Joint Photographic Experts Group, JPEG) standard is applicable to the continually varying rest image as an important technology of image compression encoding to JPEG (joint photographic experts group), comprises the continuous variation of tonal gradation and color two aspects.
JPEG comprises two kinds of basic compression methods: a kind of is lossy compression method, is also referred to as discrete cosine transform (Discrete Cosine Transform, DCT) compression method; Another kind is a lossless compress, is also referred to as the prediction compression method.That normal use is the former, and promptly the DCT compression method can also be called baseline order encoding and decoding (Baseline Sequential Codec) method.As shown in Figure 1, in the prior art based on the JPEG of DCT coding schematic flow sheet.At first source image data is divided into the 8X8 block of pixels, is that unit encodes with the 8X8 block of pixels.Through forward discrete cosine transform (Forward DCT, FDCT) after, generates 64 DCT coefficients, these DCT coefficients are arranged according to the Zigzag order from the low frequency to the high frequency, first value is direct current (DC) coefficient, other 63 are interchange (AC) coefficient.High frequency coefficient is positioned at the lower right area of DCT coefficient matrix.Then, use the good quantization table that standardized that each DCT coefficient is quantized.The DC coefficient of last quantification is used to predict current DC coefficient, then its difference is encoded; 63 AC coefficients do not carry out differential coding.At last, the DCT coefficient is carried out entropy coding.The mode of entropy coding has two kinds, a kind of employing Huffman coded system, the another kind of arithmetic coding mode that adopts.Baseline uses the Huffman coding.In the FDCT transform and quantization, the loss that can introduce the precision of images is distortion.Because human eye is insensitive to high fdrequency component, and the high fdrequency component in the image is removed, compressed preferably, can obtain visual high fidelity image simultaneously.
The process and the cataloged procedure of decoding are opposite, as shown in Figure 2, in the prior art based on the JPEG decoding process schematic diagram of DCT.The decoding and displaying flow process of jpeg image comprises three steps, the i.e. demonstration of the decoding of the storage of image, image and image.The storage of image is exactly to utilize serial communication, USB interface or Ethernet data transmission to obtain the jpeg image packed data and deposit data in high-speed memory, as: flash memory (Flash), static random access memory (Static Random Access Memory, SRAM) etc.; The decoding process of image is opposite with above-mentioned coding flow process basically, mainly comprise preliminary treatment, Huffman (Huffman) decoding, inverse quantization, inverse discrete cosine transformation (Inverse Discrete CosineTransform, IDCT); The demonstration of image is that decoded view data is converted to rgb signal, and de-energisation picture tube (CRT) or LCDs (LCD) are finished the demonstration reduction of the display color of original image.
(Digital Photo Frame is a kind of mass consumption electronic product that is used for showing digital photograph DPF) to digital photo frame, is mainly used in the decoding and displaying jpeg image.Jpeg image can pass in the built-in flash memory of digital photo frame (Flash) by WiFi network, USB interface, also can be from the storage medium of extrapolation, include compact flash (Compact Flash, CF), memory stick (Memory Stick, MS), secure digital (Secure Digital, SD) card, multimedia (Multi Media, MMC) card, (Smart Media, SM), portable hard drive popular Flash cards such as (MicroDrive).
The picture size of the JPEG ASCII stream file ASCII of existing its input of DPF is usually much larger than the display resolution of LCDs, typically, the dimension of picture that digital camera is taken pictures out is 1024 * 768 to 4000 * 4000, and the LCDs of DPF is usually about 800 * 480, and low side DPF screen dimensions is lower.Therefore, can waste very big memory space when these cross high-resolution jpeg compressed image file in storage, and follow-up these are crossed can increase unnecessary computational complexity when high-resolution jpeg compressed image file is decoded by standard, thereby increased cost and power consumption.
Summary of the invention
The embodiment of the invention provides a kind of method for encoding images and device, stored the problem of the waste memory space that high-resolution compressed image file causes in order to solution, and the high problem of computational complexity that this image is decoded and caused, realize saving memory space, reduce the computational complexity of decoding, reduce cost and power consumption.
The embodiment of the invention provides a kind of method for encoding images, comprising:
Read the compressed bit stream of original image, the compressed bit stream of described original image is resolved, obtain the resolution of described original image;
To carry out entropy decoding, counter-scanning through the compressed bit stream of resolving, obtain original dct coefficient matrix;
According to the relation between the resolution of the resolution of described original image and display unit, determine the pattern that abandons of high frequency discrete cosine transform coefficient;
Abandon corresponding high frequency discrete cosine transform coefficient according to the described pattern that abandons;
Scan abandoning new dct coefficient matrix behind the high frequency discrete cosine transform coefficient, entropy coding, form the conversion code stream of compression.
The embodiment of the invention provides a kind of picture coding device, comprising:
First decoder module, be used to read the compressed bit stream of original image, the compressed bit stream of described original image is resolved, obtain the resolution of described original image, to carry out entropy decoding, counter-scanning through the compressed bit stream of resolving, obtain original dct coefficient matrix;
Processing module is used for determining the pattern that abandons of high frequency discrete cosine transform coefficient according to the relation between the resolution of the resolution of described original image and display unit, abandons corresponding high frequency discrete cosine transform coefficient according to the described pattern that abandons;
Coding module is used for scanning abandoning new dct coefficient matrix behind the high frequency discrete cosine transform coefficient, entropy coding, forms the conversion code stream of compression.
As shown from the above technical solution, behind the discrete cosine transform coefficient of the high frequency of the compressed bit stream of the embodiment of the invention by abandoning original image in advance, again it is encoded, stored the shared memory space of high-resolution compressed image file thereby saved, and reduced the computational complexity that this image is decoded, reduced cost and power consumption.
Description of drawings
Fig. 1 is based on the JPEG of DCT coding schematic flow sheet in the prior art;
Fig. 2 is based on the JPEG decoding process schematic diagram of DCT in the prior art;
Fig. 3 is the schematic flow sheet of first embodiment of method for encoding images of the present invention;
Fig. 4 is the schematic flow sheet of second embodiment of method for encoding images of the present invention;
Fig. 5 is the schematic flow sheet of the 3rd embodiment of method for encoding images of the present invention;
Fig. 6 is the schematic flow sheet of the 4th embodiment of method for encoding images of the present invention;
Fig. 7 is the structural representation of first embodiment of picture coding device of the present invention;
Fig. 8 is the structural representation of second embodiment of picture coding device of the present invention.
Embodiment
Below in conjunction with accompanying drawing specific embodiments of the invention are described in further detail.
As shown in Figure 3, be the schematic flow sheet of first embodiment of method for encoding images of the present invention.Present embodiment may further comprise the steps:
Step 301, receive or from storage card, read the compressed bit stream of original image from network;
Step 302, the compressed bit stream of described original image is resolved, obtain the resolution of described original image;
Step 303, the compressed bit stream that process is resolved carry out entropy decoding, counter-scanning, obtain original DCT coefficient matrix;
Step 304, according to the relation between the resolution of the resolution of described original image and display unit, determine the pattern that abandons of high frequency DCT coefficient;
Step 305, abandon corresponding high frequency DCT coefficient according to the described pattern that abandons;
Step 306, scan abandoning new DCT coefficient matrix behind the high frequency DCT coefficient, entropy coding, form the conversion code stream of compression.
Behind the discrete cosine transform coefficient of the high frequency of the compressed bit stream of present embodiment by abandoning original image in advance, again it is encoded, stored the shared memory space of high-resolution compressed image file thereby saved, and reduced the computational complexity that this image is decoded, reduced cost and power consumption.
As shown in Figure 4, be the schematic flow sheet of second embodiment of method for encoding images of the present invention.Present embodiment may further comprise the steps:
Step 401, receive or from storage card, read the JPEG compressed bit stream of original image from network;
Step 402, the jpeg file in the original JPEG compressed bit stream is resolved, obtain the resolution parameter of original image;
Step 403, the original JPEG compressed bit stream that process is resolved carry out Hofmann decoding, counter-scanning, obtain original DCT coefficient matrix;
Step 404, according to the relation between the resolution of the resolution of original jpeg image and display unit, determine the pattern that abandons of high frequency DCT coefficient.
In this step, DCT coefficient matrix for 8 * 8, can be according to the resolution of the resolution of original JPEG code stream and display unit such as LCD in level, vertical both direction ratio separately, determine level, vertical both direction abandon quantity after, abandon corresponding high frequency discrete cosine transform coefficient for the quantity that abandons according to determined level, vertical both direction.Wherein,
Horizontal direction abandon quantity be high frequency dct coefficient matrix abandon columns, i.e. M '=8-[8 * K/Sx], the span of M ' is [0,7], and is integer;
Vertical direction abandon quantity be high frequency dct coefficient matrix abandon line number, i.e. N '=8-[8 * K/Sy], the span of N ' is [0,7], and is integer;
Wherein, K is for considering the adjustment coefficient of display quality requirement, local memory capacity, decoding processing ability, and its span is [1,2]; Sx is the resolution of described original JPEG compressed bit stream and the resolution ratio in the horizontal direction of described display unit; Sy is the ratio of the resolution of the resolution of described original JPEG compressed bit stream and described display unit in vertical direction;
Step 405, basis abandon pattern and abandon corresponding high frequency DCT coefficient.
In this step, can the DCT coefficient matrix be dropped high frequency DCT coefficient be changed to 0 by the pattern of having determined that abandons.
For 8 * 8DCT coefficient matrix, remove to keep this DCT coefficient matrix upper left corner M * N (M=8-M '; N=8-N ') outside the DCT coefficient, abandon all the other coefficients, the M here, N are the positive integer between [1,8].
The pattern identification Mode that abandons in the present embodiment in the step 105 can be definite by following formula:
Abandon pattern identification Mode=N ' * 16+M '.
For example: as Sx, when Sy is 2, K gets 1.3 respectively, can determine that M ', N ' are 3, and promptly M, N are 5, promptly only keeps 5 * 5 the DCT coefficients in the upper left corner, and all the other coefficients then are dropped.It abandons pattern identification Mode is 51, is expressed as 0x33 with hexadecimal digit;
Step 406, scan abandoning new DCT coefficient matrix behind the high frequency DCT coefficient, entropy coding, form the conversion JPEG code stream of compression;
Step 407, the described conversion JPEG code stream of storage are to local storage medium.
Amended conversion JPEG code stream is deposited in local NAND Flash or the storage card;
Step 108, show request, from local storage medium, read conversion JPEG code stream, the new jpeg file in the conversion JPEG code stream is resolved according to picture;
Step 409, the conversion JPEG code stream that process is resolved carry out entropy decoding, counter-scanning, obtain new DCT coefficient matrix;
Step 410, new DCT coefficient matrix is carried out inverse quantization, IDCT, obtain the JPEG decipher reestablishment image;
Step 411, the JPEG decipher reestablishment image is zoomed to the display resolution of regulation, output shows.
In the present embodiment, according to abandoning pattern corresponding high frequency DCT coefficient is put after 0, again after the DCT coefficient matrix is encoded, is stored, carry out follow-up decoding again, saved and stored the shared memory space of high-resolution jpeg compressed image file, reduce the operand when decoding once more, reduced cost and power consumption.
As shown in Figure 5, be the schematic flow sheet of the 3rd embodiment of method for encoding images of the present invention.Present embodiment may further comprise the steps:
Step 501, receive or from storage card, read the JPEG compressed bit stream of original image from network;
Step 502, the jpeg file in the original JPEG compressed bit stream is resolved, obtain the resolution parameter of original image;
Step 503, the original JPEG compressed bit stream that process is resolved carry out Hofmann decoding, counter-scanning, obtain original DCT coefficient matrix;
Step 504, according to the relation between the resolution of the resolution of original jpeg image and display unit, determine the pattern that abandons of high frequency DCT coefficient.
In this step, DCT coefficient matrix for 8 * 8, can be according to the resolution of the resolution of original JPEG code stream and display unit such as LCD in level, vertical both direction ratio separately, determine level, vertical both direction abandon quantity after, abandon corresponding high frequency discrete cosine transform coefficient for the quantity that abandons according to determined level, vertical both direction.Wherein,
Horizontal direction abandon quantity be high frequency dct coefficient matrix abandon columns, i.e. M '=8-[8 * K/Sx], the span of M ' is [0,7], and is integer;
Vertical direction abandon quantity be high frequency dct coefficient matrix abandon line number, i.e. N '=8-[8 * K/Sy], the span of N ' is [0,7], and is integer;
Wherein, K is for considering the adjustment coefficient of display quality requirement, local memory capacity, decoding processing ability, and its span is [1,2]; Sx is the resolution of described original JPEG compressed bit stream and the resolution ratio in the horizontal direction of described display unit; Sy is the ratio of the resolution of the resolution of described original JPEG compressed bit stream and described display unit in vertical direction;
Step 505, basis abandon pattern and abandon corresponding high frequency DCT coefficient.
In this step, can the DCT coefficient matrix be dropped high frequency DCT coefficient be changed to 0 by the pattern of having determined that abandons.
For 8 * 8DCT coefficient matrix, remove to keep this DCT coefficient matrix upper left corner M * N (M=8-M '; N=8-N ') outside the DCT coefficient, abandon all the other coefficients, the M here, N are the positive integer between [1,8].
The pattern identification Mode that abandons in the present embodiment in the step 205 can be definite by following formula:
Abandon pattern identification Mode=N ' * 16+M '.
For example: as Sx, when Sy is 2, K gets 1.3 respectively, can determine that M ', N ' are 3, and promptly M, N are 5, promptly only keeps 5 * 5 the DCT coefficients in the upper left corner, and all the other coefficients then are dropped.It abandons pattern identification Mode is 51, is expressed as 0x33 with hexadecimal digit;
Step 506, scan abandoning new DCT coefficient matrix behind the high frequency DCT coefficient, entropy coding, form the conversion JPEG code stream of compression;
What step 507, storage described conversion JPEG code stream and this conversion JPEG code stream corresponding identification abandoned pattern abandons pattern identification Mode to local storage medium.
The method of wherein related storage has two kinds, a kind of is to describe in the head abandoning the jpeg file that pattern identification Mode adds conversion JPEG code stream to, and the band conversion JPEG ASCII stream file ASCII that abandons pattern identification Mode deposits among the local NAND Flash (or storage card) then; Another kind can be that amended conversion JPEG code stream is deposited among the local NAND Flash (or storage card), and add and to store the conversion code stream file into and abandon in the sign description list abandoning pattern identification Mode, abandon the sign description list at the conversion code stream file, each abandons the corresponding conversion code stream file of pattern identification data item.
Step 508, show request, from local storage medium, read conversion JPEG code stream and abandon pattern identification Mode accordingly, the new jpeg file in the conversion JPEG code stream is resolved according to picture;
Step 509, the conversion JPEG code stream that process is resolved carry out entropy decoding, counter-scanning, obtain new DCT coefficient matrix;
Step 510, basis abandon inverse quantization, the IDCT that pattern identification Mode simplifies new DCT coefficient matrix, obtain the JPEG decipher reestablishment image.
Here no longer need the new whole coefficients of DCT coefficient matrix are carried out inverse quantization, IDCT, only need that the coefficient of pattern identification Mode to M * n-quadrant, the upper left corner in the DCT coefficient matrix (promptly remove in 8 * 8 coefficient matrixes do not put 0 high frequency DCT coefficient after residual coefficient) carries out inverse quantization, IDCT gets final product according to abandoning;
Step 511, the JPEG decipher reestablishment image is zoomed to the display resolution of regulation, output shows.
In the present embodiment, according to abandoning pattern high frequency DCT coefficient is put after 0, again to after the DCT coefficient matrix is encoded, is stored after revising, carry out follow-up simplification decoding according to the pattern that abandons again, saved and stored the shared memory space of high-resolution jpeg compressed image file, further reduce the follow-up computational complexity that this jpeg image is decoded, reduced cost and power consumption.
As shown in Figure 6, be the schematic flow sheet of the 4th embodiment of method for encoding images of the present invention.Different with the 3rd embodiment of method for encoding images of the present invention is that in the present embodiment, it is not the jpeg algorithm of employing standard that coding and secondary are decoded, and can be user-defined class jpeg algorithm.Present embodiment may further comprise the steps:
Step 601, receive or from storage card, read the JPEG compressed bit stream of original image from network;
Step 602, the jpeg file in the original JPEG compressed bit stream is resolved, obtain the resolution parameter of original image;
Step 603, the original JPEG compressed bit stream that process is resolved carry out Hofmann decoding, counter-scanning, obtain original DCT coefficient matrix;
Step 604, according to the relation between the resolution of the resolution of original jpeg image and display unit, determine the pattern that abandons of high frequency DCT coefficient.
In this step, DCT coefficient matrix for 8 * 8, can be according to the resolution of the resolution of original JPEG code stream and display unit such as LCD in level, vertical both direction ratio separately, determine level, vertical both direction abandon quantity after, abandon corresponding high frequency discrete cosine transform coefficient for the quantity that abandons according to determined level, vertical both direction.Wherein,
Horizontal direction abandon quantity be high frequency dct coefficient matrix abandon columns, i.e. M '=8-[8 * K/Sx], the span of M ' is [0,7], and is integer;
Vertical direction abandon quantity be high frequency dct coefficient matrix abandon line number, i.e. N '=8-[8 * K/Sy], the span of N ' is [0,7], and is integer;
Wherein, K is for considering the adjustment coefficient of display quality requirement, local memory capacity, decoding processing ability, and its span is [1,2]; Sx is the resolution of described original JPEG compressed bit stream and the resolution ratio in the horizontal direction of described display unit; Sy is the ratio of the resolution of the resolution of described original JPEG compressed bit stream and described display unit in vertical direction.
For 8 * 8DCT coefficient matrix, remove to keep this DCT coefficient matrix upper left corner M * N (M=8-M '; N=8-N ') outside the DCT coefficient, abandon all the other coefficients, the M here, N are the positive integer between [1,8].
Except that above-mentioned rectangle abandons the pattern, also can abandon high frequency coefficient by the backward of Zig-Zag scanning;
Step 605, basis abandon pattern and abandon corresponding high frequency DCT coefficient.
Abandon under the pattern situation at rectangle, with 8 * 8DCT coefficient matrix, become except that M * N (M=8-M '; N=8-N ', M, N are the positive integer between [1,8]) coefficient matrix, the entry of a matrix element of this M * N is 8 * 8DCT coefficient matrix upper left corner M * N DCT coefficient.
The pattern identification Mode that abandons in the present embodiment in the step 305 can be definite by following formula:
Abandon pattern identification Mode=N ' * 16+M '.
For example: as Sx, when Sy is 2, K gets 1.3 respectively, can determine that M ', N ' are 3, and promptly M, N are 5, promptly only keeps 5 * 5 the DCT coefficients in the upper left corner, and all the other coefficients then are dropped.It abandons pattern identification Mode is 51, is expressed as 0x33 with hexadecimal digit;
Step 606, scan abandoning new DCT coefficient matrix behind the high frequency DCT coefficient, entropy coding, form the conversion code stream of compression;
Here new coefficient matrix size no longer is 8 * 8, but M * N (M, N are the positive integer between [1,8]).The scanning here can be the Zig-Zag scanning of still using in the Joint Photographic Experts Group to 8 * 8 matrixes, just skips the coefficient that has abandoned; Also can use other self-defining scanning algorithm.Here entropy coding can be a huffman coding; Also can use other entropy coding, as arithmetic coding;
What step 607, storage described conversion code stream and this conversion code stream corresponding identification abandoned pattern abandons pattern identification Mode to local storage medium.
The method of wherein related storage has two kinds, and a kind of is to abandon in the description head that pattern identification Mode adds the conversion code stream file to, then band abandon pattern identification Mode the conversion code stream file deposit among the local NAND Flash (or storage card); Another kind can be that amended conversion code stream is deposited among the local NAND Flash (or storage card), and add and to store the conversion code stream file into and abandon in the sign description list abandoning pattern identification Mode, abandon the sign description list at the conversion code stream file, each abandons the corresponding conversion code stream file of pattern identification data item;
Step 608, subsequently shows request according to picture, reads correspondingly to have deposited the conversion code stream of local storage medium in and abandoned pattern identification Mode accordingly from local storage medium, and the new ASCII stream file ASCII in the conversion code stream is resolved;
Step 609, the conversion code stream that process is resolved carry out entropy decoding, counter-scanning, obtain new DCT coefficient matrix.
Here entropy decoding is the inverse process of entropy coding in the step 306, and the counter-scanning here is the inverse process of scanning in the step 306, and the DCT coefficient matrix of conversion code stream is M * N matrix, M=8-M '; N=8-N ', M ' and N ' are the positive integer between [0,7], and M ' and N ' obtain by abandoning pattern identification Mode;
Step 610, basis abandon inverse quantization, the IDCT that pattern identification Mode simplifies new DCT coefficient matrix, obtain decipher reestablishment image.
Abandon columns M ' and abandon line number N ' by abandoning pattern identification Mode acquisition high frequency coefficient, as obtaining M '=3 and N '=3, M=5 by Mode=0x33; N=5; Here only need carry out inverse quantization and IDCT, but the reconstructed image piece of IDCT output is 8 * 8 to 5 * 5 DCT coefficient matrix;
Step 611, decipher reestablishment image is zoomed to the display resolution of regulation, output shows.
In the present embodiment, abandon after the high frequency DCT coefficient according to the pattern of abandoning, again after residue DCT coefficient matrix being encoded, is stored, carry out follow-up simplification decoding again, saved and stored the shared memory space of high-resolution compressed image, reduce the follow-up computational complexity that this compressed image is decoded, reduced cost and power consumption.
As shown in Figure 7, be the structural representation of first embodiment of picture coding device of the present invention.Present embodiment comprises first decoder module 10, processing module 20 and the coding module 30 that connects in turn.First decoder module 10 is used for receiving or reading from storage card from network the JPEG compressed bit stream of original image, compressed bit stream to original image is resolved, obtain the resolution of described original image, to carrying out Hofmann decoding, counter-scanning, obtain original DCT coefficient matrix through the compressed bit stream of resolving; Processing module 20 is used for according to the relation between the resolution of the resolution of described original image and display unit, determines the pattern that abandons of high frequency DCT coefficient, abandons corresponding high frequency DCT coefficient according to the described pattern that abandons; Coding module 30 is used for scanning abandoning new DCT coefficient matrix behind the high frequency DCT coefficient, entropy coding, forms the conversion code stream of compression.
In the present embodiment, discard module is divided after the corresponding high frequency DCT coefficient according to abandoning the pattern discarded part, again the DCT coefficient matrix is encoded by coding module, stored the shared memory space of high-resolution compressed image thereby saved, reduce the follow-up computational complexity that this compressed image is decoded, thereby reduced cost and power consumption.
Further, processing module 20 can comprise interconnective acquiring unit 21 and discarding unit 22 in the present embodiment.Wherein, acquiring unit 21 is used for according to the relation between the resolution of the resolution of described original image and display unit, determines the pattern that abandons of high frequency discrete cosine transform coefficient; The pattern that abandons that discarding unit 22 is used for obtaining according to described acquiring unit abandons corresponding high frequency discrete cosine transform coefficient.
DCT coefficient matrix for 8 * 8, acquiring unit 21 can be according to the resolution of the resolution of original JPEG code stream and display unit such as LCD in level, vertical both direction ratio separately, determine level, vertical both direction abandon quantity after, abandon corresponding high frequency discrete cosine transform coefficient for discarding unit 22 according to the quantity that abandons of acquiring unit 21 determined levels, vertical both direction.Correspondingly, acquiring unit 21 can comprise that abandoning columns obtains subelement and abandon line number and obtain subelement.Abandon columns and obtain subelement, be used for according to the relation between the horizontal resolution of the horizontal resolution of described original image and display unit, determine high frequency the DCT coefficient matrix abandon columns; Abandon line number and obtain subelement, be used for according to the relation between the vertical resolution of the vertical resolution of described original image and display unit, determine high frequency the DCT coefficient matrix abandon line number.Wherein,
Horizontal direction abandon quantity be high frequency dct coefficient matrix abandon columns, i.e. M '=8-[8 * K/Sx], the span of M ' is [0,7], and is integer;
Vertical direction abandon quantity be high frequency dct coefficient matrix abandon line number, i.e. N '=8-[8 * K/Sy], the span of N ' is [0,7], and is integer;
Wherein, K is for considering the adjustment coefficient of display quality requirement, local memory capacity, decoding processing ability, and its span is [1,2]; Sx is the resolution of described original JPEG compressed bit stream and the resolution ratio in the horizontal direction of described display unit; Sy is the ratio of the resolution of the resolution of described original JPEG compressed bit stream and described display unit in vertical direction.
Discarding unit 22 can be dropped high frequency DCT coefficient to the DCT coefficient matrix and be changed to 0 by the definite pattern that abandons of acquiring unit 21.For 8 * 8DCT coefficient matrix, remove to keep this DCT coefficient matrix upper left corner M * N (M=8-M '; N=8-N ') outside the DCT coefficient, discarding unit 22 abandons all the other coefficients, and the M here, N are the positive integer between [1,8].
The pattern identification Mode that abandons wherein can be definite by following formula:
Abandon pattern identification Mode=N ' * 16+M '.
For example: as Sx, when Sy is 2, K gets 1.3 respectively, can determine that M ', N ' are 3, and promptly M, N are 5, promptly only keeps 5 * 5 the DCT coefficients in the upper left corner, and all the other coefficients then are dropped.It abandons pattern identification Mode is 51, is expressed as 0x33 with hexadecimal digit.
As shown in Figure 8, be the structural representation of second embodiment of picture coding device of the present invention.On the basis of a last embodiment, present embodiment can also comprise memory module 40, second decoder module 50 and display module 60.Memory module 40 is used for the described conversion code stream that memory encoding module 30 is stored; Second decoder module 50 is used for reading the conversion code stream according to picture demonstration request from described memory module, and the described conversion code stream of decoding obtains decipher reestablishment image; Display module 60 is used for described decipher reestablishment image is carried out convergent-divergent and demonstration.
In the present embodiment, discard module is divided after the corresponding high frequency DCT coefficient according to abandoning the pattern discarded part, again the DCT coefficient matrix is encoded by coding module, after memory module is stored it, second decoder module carries out follow-up simplification decoding again, obtains to show behind the decipher reestablishment image, stores the shared memory space of high-resolution compressed image thereby saved, reduce the follow-up computational complexity that this compressed image is decoded, thereby reduced cost and power consumption.
Further, memory module 40 can also be used to store the pattern information that abandons of described conversion code stream correspondence in the present embodiment.
Further, second decoder module 50 can also be used for being abandoned inverse quantization, the inverse discrete cosine transformation that pattern information is simplified described new dct coefficient matrix according to what memory module 40 stored in the present embodiment.
In addition, one of ordinary skill in the art will appreciate that all or part of flow process that realizes in the foregoing description method, be to instruct relevant hardware to finish by program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-OnlyMemory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (13)

1, a kind of method for encoding images is characterized in that comprising:
Read the compressed bit stream of original image, the compressed bit stream of described original image is resolved, obtain the resolution of described original image;
To carry out entropy decoding, counter-scanning through the compressed bit stream of resolving, obtain original dct coefficient matrix;
According to the relation between the resolution of the resolution of described original image and display unit, determine the pattern that abandons of high frequency discrete cosine transform coefficient;
Abandon corresponding high frequency discrete cosine transform coefficient according to the described pattern that abandons;
Scan abandoning new dct coefficient matrix behind the high frequency discrete cosine transform coefficient, entropy coding, form the conversion code stream of compression.
2, method for encoding images according to claim 1 is characterized in that described basis abandons pattern and abandons corresponding high frequency discrete cosine transform coefficient and specifically comprise:
According to the resolution of the resolution of described original image and described display unit ratio separately, determine the quantity that abandons of level, vertical both direction at level, vertical both direction;
The quantity that abandons according to described level, vertical both direction abandons corresponding high frequency discrete cosine transform coefficient.
3, method for encoding images according to claim 2 is characterized in that, when described dct coefficient matrix was 8 * 8 rank, the quantity that abandons of described horizontal direction comprised:
The dct coefficient matrix of high frequency abandon columns M '=8-[8 * K/Sx], M ' is the integer between 0~7, wherein, K is for adjusting coefficient, its span is 1~2; Sx is the resolution ratio in the horizontal direction of the resolution and the described display unit of described original image;
The quantity that abandons of described vertical direction comprises:
The dct coefficient matrix of high frequency abandon line number N '=8-[8 * K/Sy], N ' is the integer between 0~7, wherein, K is for adjusting coefficient, its span is 1~2; Sy is the ratio of the resolution of the resolution of described original image and described display unit in vertical direction.
4, coding method according to claim 1 is characterized in that describedly scanning abandoning new dct coefficient matrix behind the high frequency discrete cosine transform coefficient, entropy coding, also comprises after forming the conversion code stream of compression:
Store described conversion code and flow to local storage medium;
From local storage medium, read the corresponding conversion code stream that has deposited local storage medium in according to picture demonstration request;
The described conversion code stream of decoding obtains decipher reestablishment image;
Described decipher reestablishment image is carried out convergent-divergent and demonstration.
5, method for encoding images according to claim 4 is characterized in that the described conversion code of described storage flows to local storage medium and specifically comprises: that stores described conversion code stream and described conversion code stream correspondence abandons pattern information to local storage medium;
Show that according to picture asking to read the corresponding conversion code stream that has deposited local storage medium in from local storage medium specifically comprises: show according to picture and ask from local storage medium, to read corresponding conversion code stream and the described pattern information that abandons that has deposited local storage medium in;
The described conversion code stream of described decoding obtains decipher reestablishment image and specifically comprises: according to the described pattern information that abandons described conversion code stream is decoded.
6, method for encoding images according to claim 5 is characterized in that the described pattern information that abandons specifically comprises and abandons pattern identification, describedly abandons the function that abandons quantity that abandons quantity and described vertical direction that pattern identification is described horizontal direction.
7,, it is characterized in that the described conversion code stream of described decoding obtains decipher reestablishment image and specifically comprises according to claim 5 or 6 described method for encoding images:
The analytic trnasformation code stream carries out entropy decoding, counter-scanning, obtains new dct coefficient matrix;
Described new dct coefficient matrix is carried out inverse quantization, inverse discrete cosine transformation, obtain decipher reestablishment image.
8, a kind of picture coding device is characterized in that comprising:
First decoder module, be used to read the compressed bit stream of original image, the compressed bit stream of described original image is resolved, obtain the resolution of described original image, to carry out entropy decoding, counter-scanning through the compressed bit stream of resolving, obtain original dct coefficient matrix;
Processing module is used for determining the pattern that abandons of high frequency discrete cosine transform coefficient according to the relation between the resolution of the resolution of described original image and display unit, abandons corresponding high frequency discrete cosine transform coefficient according to the described pattern that abandons;
Coding module is used for scanning abandoning new dct coefficient matrix behind the high frequency discrete cosine transform coefficient, entropy coding, forms the conversion code stream of compression.
9, picture coding device according to claim 8 is characterized in that described processing module comprises:
Acquiring unit is used for determining the pattern that abandons of high frequency discrete cosine transform coefficient according to the relation between the resolution of the resolution of described original image and display unit;
Discarding unit, the pattern that abandons that is used for obtaining according to described acquiring unit abandons corresponding high frequency discrete cosine transform coefficient.
10, picture coding device according to claim 9 is characterized in that, when described dct coefficient matrix was 8 * 8 rank, described acquiring unit comprised:
Abandon columns and obtain subelement, be used for according to the relation between the horizontal resolution of the horizontal resolution of described original image and display unit, determine high frequency dct coefficient matrix abandon columns, the described columns M '=8-[8 * K/Sx that abandons], M ' is the integer between 0~7, wherein, K is for adjusting coefficient, and its span is 1~2; Sx is the resolution ratio in the horizontal direction of the resolution and the described display unit of described original image;
Abandon line number and obtain subelement, be used for according to the relation between the vertical resolution of the vertical resolution of described original image and display unit, determine high frequency dct coefficient matrix abandon line number, the described line number N '=8-[8 * K/Sy that abandons], N ' is the integer between 0~7, wherein, K is for adjusting coefficient, and its span is 1~2; Sy is the ratio of the resolution of the resolution of described original image and described display unit in vertical direction.
11, picture coding device according to claim 8 is characterized in that described picture coding device also comprises:
Memory module is used to store the conversion code stream that described coding module generates;
Second decoder module is used for reading described conversion code stream according to picture demonstration request from described memory module, and the described conversion code stream of decoding obtains decipher reestablishment image;
Display module is used for described decipher reestablishment image is carried out convergent-divergent and demonstration.
12, picture coding device according to claim 11 is characterized in that described memory module also is used to store the pattern information that abandons of described conversion code stream correspondence.
13, picture coding device according to claim 12 is characterized in that described second decoder module also is used for according to the pattern information that abandons that described memory module is stored described new dct coefficient matrix being carried out inverse quantization, inverse discrete cosine transformation.
CN 200810105766 2008-04-30 2008-04-30 Method for encoding images and device Active CN100539700C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200810105766 CN100539700C (en) 2008-04-30 2008-04-30 Method for encoding images and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200810105766 CN100539700C (en) 2008-04-30 2008-04-30 Method for encoding images and device

Publications (2)

Publication Number Publication Date
CN101267566A CN101267566A (en) 2008-09-17
CN100539700C true CN100539700C (en) 2009-09-09

Family

ID=39989646

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200810105766 Active CN100539700C (en) 2008-04-30 2008-04-30 Method for encoding images and device

Country Status (1)

Country Link
CN (1) CN100539700C (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107277551B (en) * 2017-06-12 2019-08-23 电子科技大学 A kind of Approximation Discrete cosine transform method for image procossing
CN110555345B (en) * 2018-06-01 2022-06-28 赛灵思电子科技(北京)有限公司 Intelligent image analysis system and method
CN108810549B (en) * 2018-06-06 2021-04-27 天津大学 Low-power-consumption-oriented streaming media playing method
US11403782B2 (en) * 2019-12-31 2022-08-02 Alibaba Group Holding Limited Static channel filtering in frequency domain
CN113473139A (en) * 2020-03-31 2021-10-01 华为技术有限公司 Image processing method and image processing device
WO2022041206A1 (en) * 2020-08-31 2022-03-03 深圳市大疆创新科技有限公司 Image encoding method and apparatus, image decoding method and apparatus, and storage medium
CN112767503B (en) * 2021-01-15 2022-08-12 北京航空航天大学 JPEG compression coding-based digital pathology full-slice image rapid analysis method

Also Published As

Publication number Publication date
CN101267566A (en) 2008-09-17

Similar Documents

Publication Publication Date Title
CN100539700C (en) Method for encoding images and device
US5903669A (en) Image processing apparatus and method
CN104349171B (en) The compression of images coding/decoding device and coding and decoding method of a kind of virtually lossless
CN100524452C (en) Digital image storage, displaying method and device
TW278299B (en)
CN100576195C (en) With the system and method for lossless manner to digital picture and voice data decoding
US20020018597A1 (en) Image processing system, image processing apparatus, image input apparatus, image output apparatus and method, and storage medium
CN101662682A (en) video encoding techniques
CN101933331A (en) Video encoding device, video decoding device, video encoding method, video decoding method, and video encoding or decoding program
EP1091592A3 (en) Video signal encoding apparatus
JPH10126608A (en) Compression digital data processing method
KR20070028404A (en) Method of storing pictures in a memory using compression coding and cost function including power consumption
CN100409693C (en) Orthogonal transformation method for image and video compression
CN101729901A (en) System and method for image compression
CN117560511A (en) Spacer image compression method and system based on graph segmentation technology and electric power inspection
CN101370142B (en) Image decoding and zooming method and device, image display system
CN102065288B (en) Video processing system and method realized by combining software with hardware and device thereof
CN103986930A (en) Registration picture image compression method suitable for small-capacity information carrier
CN105376578A (en) Image compression method and device
CN115086670A (en) Low-bit-rate encoding and decoding method and system for high-definition microscopic video
TW200942036A (en) Method and apparatus for generating coded block pattern for highpass coeffecients
KR20060022894A (en) Apparatus and method for generating thumbnail image in mobile terminal
CN100576917C (en) The method and system of inversely scanning frequency efficiency
CN105007483B (en) A kind of screen content coding-decoding method compatible with H264 standards
WO2023185806A9 (en) Image coding method and apparatus, image decoding method and apparatus, and electronic device and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant