CN105992001B - A kind of pair of picture carries out the method and device of quantification treatment - Google Patents

A kind of pair of picture carries out the method and device of quantification treatment Download PDF

Info

Publication number
CN105992001B
CN105992001B CN201510093071.5A CN201510093071A CN105992001B CN 105992001 B CN105992001 B CN 105992001B CN 201510093071 A CN201510093071 A CN 201510093071A CN 105992001 B CN105992001 B CN 105992001B
Authority
CN
China
Prior art keywords
macro block
residual error
error data
described image
image macro
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
CN201510093071.5A
Other languages
Chinese (zh)
Other versions
CN105992001A (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.)
Shenzhen Tencent Computer Systems Co Ltd
Original Assignee
Shenzhen Tencent Computer Systems 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 Shenzhen Tencent Computer Systems Co Ltd filed Critical Shenzhen Tencent Computer Systems Co Ltd
Priority to CN201510093071.5A priority Critical patent/CN105992001B/en
Publication of CN105992001A publication Critical patent/CN105992001A/en
Application granted granted Critical
Publication of CN105992001B publication Critical patent/CN105992001B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses the method and devices that a kind of pair of picture carries out quantification treatment, belong to image code domain.The described method includes: dividing to picture, the image macro that the picture includes is obtained;Prediction processing is carried out to described image macro block, obtains the residual error data for each pixel that described image macro block includes;The residual error data for each pixel for including according to described image macro block calculates the quantization step of described image macro block;According to the residual error data for each pixel that the quantization step and described image macro block include, quantification treatment is carried out to described image macro block.Described device includes: division module, prediction module, computing module and quantization modules.The present invention being capable of lower quantization granularity and raising picture compression ratio.

Description

A kind of pair of picture carries out the method and device of quantification treatment
Technical field
The present invention relates to the method and devices that image code domain, in particular to a kind of pair of picture carry out quantification treatment.
Background technique
The terminals such as mobile phone all have a camera function, and user usually uses camera function to shoot picture, and think should by user sometimes Picture is shared with other people, and then the picture is uploaded to network side and downloads and browse for other people by user.Network side is receiving this When picture, which is predicted, is converted, is quantified and the processing such as entropy coding are to be converted into different resolution size for the picture Picture, to meet different downloading demands.
The process that picture is handled at present are as follows: prediction is carried out to the picture and handles to obtain residual error picture, the residual plot The residual error data for each pixel that piece includes by the picture forms;According to preset tile location information, by the residual plot Piece is divided into four image blocks;For any one image block, according to the quantization step of the preset image block and the image block packet The residual error data of each pixel included carries out quantification treatment to the image block and obtains each pixel that the image block includes Quantized value;According to the quantized value for the pixel that each image block includes, entropy coding is carried out to the picture and obtains compressed image Code stream.
In the implementation of the present invention, the inventor finds that the existing technology has at least the following problems:
Due to the quantization step of each image block be in advance it is preset, four continuous image blocks can only be divided into, draw Gradation degree is big, causes quantization granularities big, reduces picture compression ratio.
Summary of the invention
For lower quantization granularity and picture compression ratio is improved, the present invention provides a kind of pair of pictures to carry out quantification treatment Method and device.The technical solution is as follows:
The method that a kind of pair of picture carries out quantification treatment, which comprises
Picture is divided, the image macro that the picture includes is obtained;
Prediction processing is carried out to described image macro block, obtains the residual error number for each pixel that described image macro block includes According to;
The residual error data for each pixel for including according to described image macro block calculates the quantization step of described image macro block;
It is macro to described image according to the residual error data for each pixel that the quantization step and described image macro block include Block carries out quantification treatment.
A kind of pair of picture carries out the device of quantification treatment, and described device includes:
Division module obtains the image macro that the picture includes for dividing to picture;
Prediction module obtains each picture that described image macro block includes for carrying out prediction processing to described image macro block The residual error data of vegetarian refreshments;
Computing module, it is macro that the residual error data of each pixel for including according to described image macro block calculates described image The quantization step of block;
Quantization modules, the residual error number of each pixel for including according to the quantization step and described image macro block According to described image macro block progress quantification treatment.
In embodiments of the present invention, since the residual error data for each pixel that can include according to the image macro calculates The quantization step of the image macro, it is possible to picture is marked off into more image macros, refinement is carried out to picture, Improve compression ratio.
Detailed description of the invention
Fig. 1 is the method flow diagram that a kind of pair of picture that the embodiment of the present invention 1 provides carries out quantification treatment;
Fig. 2-1 is the method flow diagram that a kind of pair of picture that the embodiment of the present invention 2 provides carries out quantification treatment;
Fig. 2-2 is a kind of interface schematic diagram for division picture that the embodiment of the present invention 2 provides;
Fig. 2-3 is the pixel number histogram that the embodiment of the present invention 2 provides;
Fig. 2-4 is a kind of electrical block diagram that the embodiment of the present invention 2 provides;
Fig. 3-1 is the method flow diagram that a kind of pair of picture that the embodiment of the present invention 3 provides carries out quantification treatment;
Fig. 3-2 is a kind of stream for carrying out quantification treatment to picture using a variety of prediction modes that the embodiment of the present invention 3 provides Cheng Tu;
Fig. 4 is the apparatus structure schematic diagram that a kind of pair of picture that the embodiment of the present invention 4 provides carries out quantification treatment;
Fig. 5 is a kind of terminal structure schematic diagram that the embodiment of the present invention 5 provides.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
Embodiment 1
Referring to Fig. 1, the embodiment of the invention provides the methods that a kind of pair of picture carries out quantification treatment, comprising:
Step 101: picture being divided, the image macro that the picture includes is obtained.
Step 102: prediction processing being carried out to the image macro, obtains the residual error for each pixel that the image macro includes Data.
Step 103: the residual error data for each pixel for including according to the image macro calculates the quantization of the image macro Step-length.
Step 104: according to the residual error data for each pixel that the quantization step and the image macro include, to the image Macro block carries out quantification treatment.
In embodiments of the present invention, since the residual error data for each pixel that can include according to the image macro calculates The quantization step of the image macro, it is possible to picture is marked off into more image macros, refinement is carried out to picture, Improve compression ratio.
Embodiment 2
Referring to fig. 2-1, the embodiment of the invention provides the methods that a kind of pair of picture carries out quantification treatment, comprising:
Step 201: picture being divided, the image macro that the picture includes is obtained.
Specifically, according to preset macroblock size, divided to obtain the multiple images macro block that the picture includes to picture. The multiple images macro block of division such as is all at the image block of sizes.
Preset macroblock size can be 16 × 16,8 × 8 or 4 × 4 etc., if the macroblock size of some image macro is 16 × 16, then it represents that the image macro is made of 256 pixels, and similarly 8 × 8 image macro is made of 64 pixels, and 4 × 4 image macro is made of 16 pixels.
Wherein, preset macroblock size is smaller, and picture can be divided into multiple images macro block, the image macro of division Number in the next steps respectively quantifies each image macro considerably beyond four, so as to carry out essence to picture Refinement quantization.
For example, with reference to Fig. 2-2, it is assumed that preset macroblock size is 4 × 4, can for the picture of 40 × 40 sizes According to the macroblock size 4 × 4, which is divided into the image macro that 100 sizes are 4 × 4, the number of image macro Considerably beyond four, each image macro includes 16 pixels.
For any image macro block marked off, the image macro can be quantified using subsequent step, comprising:
Step 202: for any one image macro, prediction processing being carried out to the image macro, obtains the image macro packet The residual error data of each pixel included.
Presently, there are a variety of prediction modes, the corresponding tile size of every kind of prediction mode.Such as presently, there are 16 × 16 prediction modes, 8 × 8 prediction modes and 4 × 4 prediction modes, the corresponding tile size of 16 × 16 prediction modes are 16 × 16, The corresponding tile size of 8 × 8 prediction modes is that the corresponding tile size of 8 × 8,4 × 4 prediction modes is 4 × 4.
This step can be with are as follows: selects a kind of prediction mode, and the corresponding tile size of the prediction mode is less than or equal to The size of the image macro predicts the image macro according to the prediction mode, obtains the image macro and each of includes The residual error data of pixel.
For example, selecting corresponding tile size to be less than or wait for marking off the image macro that the size come is 4 × 4 In 4 × 4 prediction mode, the prediction mode selected is 4 × 4 prediction modes, according to 4 × 4 prediction modes to the image macro into Row prediction, obtain to the image macro include 16 pixels residual error data, it is assumed that the residual error data of 16 pixels point It Wei 0.3,0.5,0.7,1.5,1.4,0.7,1.2,1.2,1.4,1.5,0.7,0.7,0.5,1.2,1.2 and 0.7.
Wherein, the residual error data for each pixel predicted is time domain data, can be by the residual of each pixel Difference data is converted to frequency domain data, then executes following steps 203 again.
Step 203: according to the residual error data for each pixel that the image macro includes, calculating the macro of the image macro Block eigenvalue.
Specifically, this step may include following (1) and (2) two steps, be respectively as follows:
(1): being counted in default residual error data set from the residual error data for each pixel that the image macro includes The corresponding pixel number of each residual error data.
It include occurring all residual error datas at present in default residual error data set.
For example, for the residual error data of 16 pixels obtained in step 202, the residual error data point of 16 pixels It Wei 0.3,0.5,0.7,1.5,1.4,0.7,1.2,1.2,1.4,1.5,0.7,0.7,0.5,1.2,1.2 and 0.7;It is assumed that pre- If including 0.3,0.5,0.7,1.2,1.4,1.5,1.6,1.7 in residual error data set.From the residual error data of 16 pixels In to count the corresponding pixel number of residual error data 0.3 be 1,0.5 corresponding pixel number is 3,0.7 corresponding pixel It is 4,1.4 corresponding pixel numbers be 2,1.5 corresponding pixel numbers is 1 that number, which is 5,1.2 corresponding pixel numbers, 1.6 corresponding pixel numbers are that 0,1.7 corresponding pixel numbers are 0.
(2): according to the corresponding pixel number of each residual error data in default residual error data set, calculating the image The macro block characteristics value of macro block.
Specifically, according to the corresponding pixel number of each residual error data in default residual error data set, pixel is drawn Point number histogram, the abscissa of the pixel data graphs is the residual error data in default residual error data set, and indulges and sit It is designated as pixel number, the residual error data that the last one corresponding pixel number is not 0 is found out from the pixel histogram, The position of the residual error data found out on the horizontal scale is obtained, is selected from the corresponding pixel number of each residual error data maximum Pixel number, if maximum pixel number be greater than 1, calculate between maximum pixel number and the position of acquisition Quotient and using the quotient of calculating as the macro block characteristics value of the image macro, if maximum pixel number is less than or equal to 1, The macro block characteristics value for determining the image macro is 0.
For example, drawing such as Fig. 2-3 according to the corresponding pixel number of each residual error data in default residual error data set Shown in pixel number histogram, it is not 0 that the last one corresponding pixel number is found out from the pixel histogram Residual error data is 1.5, and obtaining the position of residual error data 1.5 on the horizontal scale is 6, from the corresponding pixel of each residual error data It is 5 that maximum pixel number is selected in number, and maximum pixel number is greater than 1, then calculate maximum pixel number 5 with Quotient between the position 6 of acquisition is 0.83 and the macro block characteristics value by the quotient of calculating 0.83 as the image macro.
Step 204: determining the range of characteristic values where the macro block characteristics value, obtain the corresponding quantization step of this feature value range The long quantization step as the image macro.
Before executing this step, multiple macro block characteristics value ranges are marked off in advance, and define each macro block characteristics value model Corresponding quantization step is enclosed, by each macro block characteristics value range of division and the corresponding quantization step of each macro block characteristics value range It is stored in the corresponding relationship of macro block characteristics value range and quantization step.
For example, four macro block characteristics value ranges are divided in advance, and respectively less than 1, more than or equal to 1 and less than or equal to 2, Greater than 2 and less than or equal to 4, it is greater than 4, and define the corresponding quantization step of four macro block characteristics value ranges respectively and be 1,2,3,4;Then, each macro block characteristics value range of division and the corresponding quantization step of each macro block characteristics value range are stored In the corresponding relationship of macro block characteristics value range as shown in Table 1 and quantization step.
Table 1
Macro block characteristics value range Quantization areas
Less than 1 1
More than or equal to 1 and it is less than or equal to 2 2
Greater than 2 and it is less than or equal to 4 3
Greater than 4 4
This step can be with are as follows: the range of characteristic values where the macro block characteristics value of the image macro is determined, according to this feature value Range, from corresponding quantization step is obtained in the corresponding relationship of macro block characteristics value range and quantization step as the image macro Quantization step.
For example, the macro block characteristics value obtained in step 203 is 0.83, the macro block characteristics value place of the image macro is determined Range of characteristic values be " less than 1 ", according to this feature value range " be greater than 1 ", from macro block characteristics value range as shown in Table 1 and amount Change in the corresponding relationship of step-length and obtains quantization step of the corresponding quantization step 1 as the image macro.
Step 205: according to the residual error data of the quantization step and each pixel, which being carried out at quantization Reason.
Specifically, the residual error data for each pixel for including by the image macro is respectively divided by the quantization of the image macro Step-length obtains the quotient of each pixel, is rounded to obtain the quantized value of each pixel to the quotient of each pixel.
Other each image macros are handled by the step of above-mentioned steps 202 to 205, obtain that the picture includes is every The quantized value of a pixel, realization quantify the picture.
For example, being quantified for the residual error data of 16 pixels obtained in step 202, and in step 204 Step-length is 1.2, and the residual error data of 16 pixels is divided by respectively to obtain 16 pixel difference with the quantization step 1.2 Corresponding quotient is 0.3,0.5,0.7,1.5,1.4,0.7,1.2,1.2,1.4,1.5,0.7,0.7,0.5,1.2,1.2 and 0.7, then Be rounded to obtain the quantized value of 16 pixels to the quotient of 16 pixels respectively, respectively 0,0,0,1,1,0,1,1,1,1, 0、0、0、1、1、0。
Method provided in this embodiment can apply FPGA (Field-Programmable Gate Array, i.e., it is existing Field programmable gate array) on, FPGA circuitry figure shown in -4, obtains image macro packet for picture progress intra prediction referring to fig. 2 Then the residual error data of each pixel included calculates quantization by the residual error data of each pixel from time domain to frequency-domain transform again Step-length carries out quantification treatment according to the residual error data of the quantization step and transformed each pixel, obtains the amount of each pixel Change value carries out entropy coding to the quantized value of each pixel and obtains picture code stream.
In embodiments of the present invention, since the residual error data for each pixel that can include according to the image macro calculates The quantization step of the image macro, it is possible to picture is marked off into more image macros, refinement is carried out to picture, Improve compression ratio.
Embodiment 3
Referring to Fig. 3-1, the embodiment of the invention provides the methods that a kind of pair of picture carries out quantification treatment, comprising:
Step 301: picture being divided, the image macro that the picture includes is obtained.
Specifically, according to preset macroblock size, divided to obtain the multiple images macro block that the picture includes to picture. The multiple images macro block of division such as is all at the image block of sizes.
Preset macroblock size can be 16 × 16,8 × 8 or 4 × 4 etc., if the macroblock size of some image macro is 16 × 16, then it represents that the image macro is made of 256 pixels, and similarly 8 × 8 image macro is made of 64 pixels, and 4 × 4 image macro is made of 16 pixels.
Wherein, preset macroblock size is smaller, and picture can be divided into multiple images macro block, the image macro of division Number in the next steps respectively quantifies each image macro considerably beyond four, so as to carry out essence to picture Refinement quantization.
For example, it is assumed that preset macroblock size is 16 × 16, it, can basis for the picture of 160 × 160 sizes The picture is divided into the image macro that 100 sizes are 16 × 16 by the macroblock size 16 × 16, and the number of image macro is remote Far more than four, each image macro includes 256 pixels.
For any image macro block marked off, the image macro can be quantified using subsequent step, comprising:
Step 302: for any one image macro, prediction processing is carried out to the image macro using a variety of prediction modes, Obtain the residual error data for each pixel that the image macro under every kind of prediction mode includes.
Presently, there are a variety of prediction modes, the corresponding tile size of every kind of prediction mode.Such as presently, there are 16 × 16 prediction modes, 8 × 8 prediction modes and 4 × 4 prediction modes, the corresponding tile size of 16 × 16 prediction modes are 16 × 16, The corresponding tile size of 8 × 8 prediction modes is that the corresponding tile size of 8 × 8,4 × 4 prediction modes is 4 × 4.
This step can be with are as follows: corresponding tile size is selected to be less than or equal to the figure from preset a variety of prediction modes As the one or more prediction modes of the size of macro block, the image macro is predicted according to every kind of selection prediction mode, is obtained To the residual error data for each pixel that the image macro includes under every kind of prediction mode of selection.
Corresponding image block is selected for marking off the image macro that the size come is 16 × 16 for example, with reference to Fig. 3-2 Size is less than or equal to 16 × 16 prediction mode, and the prediction mode of selection includes 16 × 16 prediction modes, 8 × 8 prediction modes With 4 × 4 prediction modes;The image macro is predicted according to 16 × 16 prediction modes, obtaining should under 16 × 16 prediction modes Image macro includes the residual error data of 256 pixels;The image macro is predicted according to 8 × 8 prediction modes, obtains 8 The image macro includes the residual error data of 256 pixels under × 8 prediction modes;According to 4 × 4 prediction modes to the image macro It is predicted, obtains the residual error data that the image macro under 4 × 4 prediction modes includes 256 pixels.
Wherein, the residual error data for each pixel that the image macro includes under the every kind of prediction mode predicted is The residual error data of each pixel can be converted to frequency domain data, then execute following steps 303 again by time domain data.
Step 303: according to the residual error data for each pixel that the image macro under every kind of prediction mode includes, counting respectively Calculate the macro block characteristics value of the image macro under every kind of prediction mode.
Specifically, this step may include following (1) and (2) two steps, be respectively as follows:
(1): for every kind of prediction mode, the residual error number for each pixel that the image macro includes under the prediction mode The corresponding pixel number of each residual error data in default residual error data set is counted in.
(2): according to the corresponding pixel number of each residual error data in default residual error data set, calculating in this kind The macro block characteristics value of the image macro under mode.
For example, with reference to Fig. 3-2, for 16 × 16 prediction modes, 8 × 8 prediction modes and 4 × 4 prediction modes, from 16 × 16 It is counted in the residual error data for each pixel that the image macro includes under prediction mode every in default residual error data set The corresponding pixel number of a residual error data, according to the corresponding pixel number of each residual error data in default residual error data set Mesh calculates the macro block characteristics value of the image macro under 16 × 16 prediction modes, it is assumed that is 1.6.Under 8 × 8 prediction modes Each residual error data in default residual error data set is counted in the residual error data for each pixel that the image macro includes Corresponding pixel number is calculated according to the corresponding pixel number of each residual error data in default residual error data set The macro block characteristics value of the image macro under 8 × 8 prediction modes, it is assumed that be 1.2.The image macro packet under 4 × 4 prediction modes The corresponding pixel of each residual error data in default residual error data set is counted in the residual error data of each pixel included Number calculates according to the corresponding pixel number of each residual error data in default residual error data set and predicts mould 4 × 4 The macro block characteristics value of the image macro under formula, it is assumed that be 1.4.
Step 304: maximum macro block characteristics value is selected from the macro block characteristics value of the image macro under every kind of prediction mode.
For example, the macro block characteristics value for obtaining the image macro under 16 × 16 prediction modes in step 303 is 1.6,8 × 8 The macro block characteristics value of the image macro is that the macro block characteristics value of the image macro under 1.2,4 × 4 prediction modes is under prediction mode 1.4, select maximum macro block characteristics value 1.6.
Step 305: determining the range of characteristic values where maximum macro block characteristics value, obtain the corresponding amount of this feature value range Change quantization step of the step-length as the image macro.
Before executing this step, multiple macro block characteristics value ranges are marked off in advance, and define each macro block characteristics value model Corresponding quantization step is enclosed, by each macro block characteristics value range of division and the corresponding quantization step of each macro block characteristics value range It is stored in the corresponding relationship of macro block characteristics value range and quantization step.
For example, four macro block characteristics value ranges are divided in advance, and respectively less than 1, more than or equal to 1 and less than or equal to 2, Greater than 2 and less than or equal to 4, it is greater than 4, and define the corresponding quantization step of four macro block characteristics value ranges respectively and be 1,2,3,4;Then, each macro block characteristics value range of division and the corresponding quantization step of each macro block characteristics value range are stored In the corresponding relationship of macro block characteristics value range as shown in Table 2 and quantization step.
Table 2
Macro block characteristics value range Quantization step
Less than 1 1
More than or equal to 1 and it is less than or equal to 2 2
Greater than 2 and it is less than or equal to 4 3
Greater than 4 4
This step can be with are as follows: determine the range of characteristic values where maximum macro block characteristics value, according to this feature value range, from The quantization that corresponding quantization step is obtained in macro block characteristics value range and the corresponding relationship of quantization step as the image macro walks It is long.
For example, the range of characteristic values where determining maximum macro block characteristics value is " more than or equal to 1 and to be less than or equal to 2 ", " it is greater than or equal to 1 according to this feature value range and is less than or equal to 2 ", from macro block characteristics value range as shown in Table 2 and amount Change in the corresponding relationship of step-length and obtains quantization step of the corresponding quantization step 2 as the image macro.
Step 306: the corresponding prediction mode of maximum macro block characteristics value is obtained, according to the quantization step and in the prediction mould The residual error data of each pixel under formula carries out quantification treatment to the image macro.
Specifically, the corresponding prediction mode of maximum macro block characteristics value is obtained, by the image macro packet under the prediction mode The residual error data of each pixel included divided by the quantization step of the image macro, obtains the quotient of each pixel, to every respectively The quotient of a pixel is rounded to obtain the quantized value of each pixel.
For example, obtaining corresponding 16 × 16 prediction mode of maximum macro block characteristics value 1.6, will be somebody's turn to do under 16 × 16 prediction modes The residual error data for each pixel that image macro includes divided by the quantization step of the image macro 1.2, obtains each picture respectively The quotient of vegetarian refreshments is rounded the quotient of each pixel to obtain the quantized value of each pixel.
Other each image macros are handled by the step of above-mentioned steps 302 to 306, obtain that the picture includes is every The quantized value of a pixel, realization quantify the picture.
In embodiments of the present invention, since the residual error data for each pixel that can include according to the image macro calculates The quantization step of the image macro, it is possible to picture is marked off into more image macros, refinement is carried out to picture, Improve compression ratio.In addition, in embodiments of the present invention, also being handled by a variety of prediction modes image macro, then A kind of optimal prediction mode is selected, picture is quantified according to the prediction mode of selection, improves quantification effect.
Embodiment 4
Referring to fig. 4, the embodiment of the invention provides the devices that a kind of pair of picture carries out quantification treatment, comprising:
Division module 401 obtains the image macro that the picture includes for dividing to picture;
Prediction module 402, for carrying out prediction processing to described image macro block, obtaining described image macro block each of includes The residual error data of pixel;
The residual error data of computing module 403, each pixel for including according to described image macro block calculates the figure As the quantization step of macro block;
Quantization modules 404, the residual error of each pixel for including according to the quantization step and described image macro block Data carry out quantification treatment to described image macro block.
Optionally, the computing module 403 includes:
First computing unit, the residual error data of each pixel for including according to described image macro block, calculates institute State the macro block characteristics value of image macro;
First determination unit, for determining the range of characteristic values where the macro block characteristics value;
First acquisition unit, for obtaining amount of the corresponding quantization step of the range of characteristic values as described image macro block Change step-length.
Optionally, first computing unit includes:
Count subelement, for counted from the residual error data for each pixel that described image macro block includes preset it is residual The corresponding pixel number of each residual error data for including in difference data set;
Computation subunit, for according to the corresponding pixel of each residual error data for including in the default residual error data set Point number, calculates the macro block characteristics value of described image macro block.
Optionally, the prediction module 402 is specifically used for respectively carrying out described image macro block using a variety of prediction modes Prediction processing, obtains the residual error data for each pixel that described image macro block under every kind of prediction mode includes.
Optionally, the computing module 403 includes:
Second computing unit, for according to each pixel that described image macro block includes under every kind of prediction mode Residual error data calculates separately out the macro block characteristics value of described image macro block under every kind of prediction mode;
Selecting unit, for maximum from being selected in the macro block characteristics value of described image macro block under every kind of prediction mode Macro block characteristics value;
Second determination unit, for determining the range of characteristic values where the maximum macro block characteristics value;
Second acquisition unit, for obtaining amount of the corresponding quantization step of the range of characteristic values as described image macro block Change step-length.
Optionally, the quantization modules 404 include:
Third acquiring unit, for obtaining the corresponding prediction mode of the maximum macro block characteristics value;
Quantifying unit, for including according to described image macro block under the quantization step and the prediction mode of the acquisition The residual error data of each pixel carries out quantification treatment to described image macro block.
In embodiments of the present invention, since the residual error data for each pixel that can include according to the image macro calculates The quantization step of the image macro, it is possible to picture is marked off into more image macros, refinement is carried out to picture, Improve compression ratio.
Embodiment 5
Referring to FIG. 5, the terminal can be above-mentioned it illustrates terminal structure schematic diagram involved in the embodiment of the present invention Wearable device, the method for the poster information of the display video for implementing to provide in above-described embodiment.Specifically:
Terminal 900 may include RF (Radio Frequency, radio frequency) circuit 110, include one or more meter The memory 120 of calculation machine readable storage medium storing program for executing, input unit 130, display unit 140, sensor 150, voicefrequency circuit 160, WiFi (wireless fidelity, Wireless Fidelity) module 170, the processing for including one or more than one processing core The components such as device 180 and power supply 190.It will be understood by those skilled in the art that terminal structure shown in Fig. 5 is not constituted pair The restriction of terminal may include perhaps combining certain components or different component cloth than illustrating more or fewer components It sets.Wherein:
RF circuit 110 can be used for receiving and sending messages or communication process in, signal sends and receivees, particularly, by base station After downlink information receives, one or the processing of more than one processor 180 are transferred to;In addition, the data for being related to uplink are sent to Base station.In general, RF circuit 110 includes but is not limited to antenna, at least one amplifier, tuner, one or more oscillators, uses Family identity module (SIM) card, transceiver, coupler, LNA (Low Noise Amplifier, low-noise amplifier), duplex Device etc..In addition, RF circuit 110 can also be communicated with network and other equipment by wireless communication.The wireless communication can make With any communication standard or agreement, and including but not limited to GSM (Global System of Mobile communication, entirely Ball mobile communcations system), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), LTE (Long Term Evolution, long term evolution), Email, SMS (Short Messaging Service, short message service) etc..
Memory 120 can be used for storing software program and module, and processor 180 is stored in memory 120 by operation Software program and module, thereby executing various function application and data processing.Memory 120 can mainly include storage journey Sequence area and storage data area, wherein storing program area can the (ratio of application program needed for storage program area, at least one function Such as sound-playing function, image player function) etc.;Storage data area, which can be stored, uses created number according to terminal 900 According to (such as audio data, phone directory etc.) etc..In addition, memory 120 may include high-speed random access memory, can also wrap Include nonvolatile memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts. Correspondingly, memory 120 can also include Memory Controller, to provide processor 180 and input unit 130 to memory 120 access.
Input unit 130 can be used for receiving the number or character information of input, and generate and user setting and function Control related keyboard, mouse, operating stick, optics or trackball signal input.Specifically, input unit 130 may include touching Sensitive surfaces 131 and other input equipments 132.Touch sensitive surface 131, also referred to as touch display screen or Trackpad are collected and are used Family on it or nearby touch operation (such as user using any suitable object or attachment such as finger, stylus in touch-sensitive table Operation on face 131 or near touch sensitive surface 131), and corresponding attachment device is driven according to preset formula.It is optional , touch sensitive surface 131 may include both touch detecting apparatus and touch controller.Wherein, touch detecting apparatus detection is used The touch orientation at family, and touch operation bring signal is detected, transmit a signal to touch controller;Touch controller is from touch Touch information is received in detection device, and is converted into contact coordinate, then gives processor 180, and can receive processor 180 The order sent simultaneously is executed.Furthermore, it is possible to using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves Realize touch sensitive surface 131.In addition to touch sensitive surface 131, input unit 130 can also include other input equipments 132.Specifically, Other input equipments 132 can include but is not limited to physical keyboard, function key (such as volume control button, switch key etc.), One of trace ball, mouse, operating stick etc. are a variety of.
Display unit 140 can be used for showing information input by user or the information and terminal 900 that are supplied to user Various graphical user interface, these graphical user interface can be made of figure, text, icon, video and any combination thereof. Display unit 140 may include display panel 141, optionally, can use LCD (Liquid Crystal Display, liquid crystal Show device), the forms such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) configure display panel 141.Further, touch sensitive surface 131 can cover display panel 141, when touch sensitive surface 131 detects touching on it or nearby After touching operation, processor 180 is sent to determine the type of touch event, is followed by subsequent processing device 180 according to the type of touch event Corresponding visual output is provided on display panel 141.Although touch sensitive surface 131 and display panel 141 are conducts in Fig. 5 Two independent components realize input and input function, but in some embodiments it is possible to by touch sensitive surface 131 and display Panel 141 is integrated and realizes and outputs and inputs function.
Terminal 900 may also include at least one sensor 150, such as optical sensor, motion sensor and other sensings Device.Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 141, and proximity sensor can close display when terminal 900 is moved in one's ear Panel 141 and/or backlight.As a kind of motion sensor, gravity accelerometer can detect in all directions (generally Three axis) acceleration size, can detect that size and the direction of gravity when static, can be used to identify mobile phone posture application (ratio Such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap);Extremely In other sensors such as gyroscope, barometer, hygrometer, thermometer, the infrared sensors that terminal 900 can also configure, herein It repeats no more.
Voicefrequency circuit 160, loudspeaker 161, microphone 162 can provide the audio interface between user and terminal 900.Audio Electric signal after the audio data received conversion can be transferred to loudspeaker 161, be converted to sound by loudspeaker 161 by circuit 160 Sound signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 162, after being received by voicefrequency circuit 160 Audio data is converted to, then by after the processing of audio data output processor 180, such as another end is sent to through RF circuit 110 End, or audio data is exported to memory 120 to be further processed.Voicefrequency circuit 160 is also possible that earphone jack, To provide the communication of peripheral hardware earphone Yu terminal 900.
WiFi belongs to short range wireless transmission technology, and terminal 900 can help user's transceiver electronics by WiFi module 170 Mail, browsing webpage and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 5 is shown WiFi module 170, but it is understood that, and it is not belonging to must be configured into for terminal 900, it can according to need completely Do not change in the range of the essence of invention and omits.
Processor 180 is the control centre of terminal 900, utilizes each portion of various interfaces and connection whole mobile phone Point, by running or execute the software program and/or module that are stored in memory 120, and calls and be stored in memory 120 Interior data execute the various functions and processing data of terminal 900, to carry out integral monitoring to mobile phone.Optionally, processor 180 may include one or more processing cores;Preferably, processor 180 can integrate application processor and modem processor, Wherein, the main processing operation system of application processor, user interface and application program etc., modem processor mainly handles nothing Line communication.It is understood that above-mentioned modem processor can not also be integrated into processor 180.
Terminal 900 further includes the power supply 190 (such as battery) powered to all parts, it is preferred that power supply can pass through electricity Management system and processor 180 are logically contiguous, to realize management charging, electric discharge and power consumption by power-supply management system The functions such as management.Power supply 190 can also include one or more direct current or AC power source, recharging system, power supply event Hinder the random components such as detection circuit, power adapter or inverter, power supply status indicator.
Although being not shown, terminal 900 can also include camera, bluetooth module etc., and details are not described herein.Specifically in this reality It applies in example, the display unit of terminal 900 is touch-screen display, and terminal 900 further includes having memory and one or one Above program, one of them perhaps more than one program be stored in memory and be configured to by one or one with Upper processor execution states one or more than one program includes the instruction for performing the following operation:
Picture is divided, the image macro that the picture includes is obtained;
Prediction processing is carried out to described image macro block, obtains the residual error number for each pixel that described image macro block includes According to;
The residual error data for each pixel for including according to described image macro block calculates the quantization step of described image macro block;
It is macro to described image according to the residual error data for each pixel that the quantization step and described image macro block include Block carries out quantification treatment.
Optionally, the residual error data of each pixel for including according to described image macro block calculates described image macro block Quantization step, comprising:
According to the residual error data for each pixel that described image macro block includes, the macro block for calculating described image macro block is special Value indicative;
Determine the range of characteristic values where the macro block characteristics value;
Obtain quantization step of the corresponding quantization step of the range of characteristic values as described image macro block.
Optionally, the residual error data of each pixel for including according to described image macro block, calculates described image The macro block characteristics value of macro block, comprising:
It is wrapped from being counted in default residual error data set in the residual error data for each pixel that described image macro block includes The corresponding pixel number of each residual error data included;
According to the corresponding pixel number of each residual error data for including in the default residual error data set, institute is calculated State the macro block characteristics value of image macro.
Optionally, described that prediction processing is carried out to described image macro block, obtain each pixel that described image macro block includes The residual error data of point, comprising:
Prediction processing is carried out to described image macro block respectively using a variety of prediction modes, is obtained described under every kind of prediction mode The residual error data for each pixel that image macro includes.
Optionally, the residual error data of each pixel for including according to described image macro block calculates described image macro block Quantization step, comprising:
According to the residual error data for each pixel that described image macro block includes under every kind of prediction mode, calculate separately Out under every kind of prediction mode described image macro block macro block characteristics value;
From maximum macro block characteristics value is selected under every kind of prediction mode in the macro block characteristics value of described image macro block;
Determine the range of characteristic values where the maximum macro block characteristics value;
Obtain quantization step of the corresponding quantization step of the range of characteristic values as described image macro block.
Optionally, the residual error data of each pixel for including according to the quantization step and described image macro block, Quantification treatment is carried out to described image macro block, comprising:
Obtain the corresponding prediction mode of the maximum macro block characteristics value;
According to each pixel that described image macro block includes under the quantization step and the prediction mode of the acquisition Residual error data carries out quantification treatment to described image macro block.
In embodiments of the present invention, since the residual error data for each pixel that can include according to the image macro calculates The quantization step of the image macro, it is possible to picture is marked off into more image macros, refinement is carried out to picture, Improve compression ratio.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (9)

1. the method that a kind of pair of picture carries out quantification treatment, which is characterized in that the described method includes:
Picture is divided, the image macro that the picture includes is obtained;
Prediction processing is carried out to described image macro block, obtains the residual error data for each pixel that described image macro block includes;
Include from being counted in default residual error data set in the residual error data for each pixel that described image macro block includes The corresponding pixel number of each residual error data, calculates the macro block characteristics value of described image macro block, the macro block characteristics value table Show the quotient when maximum pixel number is greater than 1, between maximum pixel number and the position of acquisition, the position instruction Be using preset the residual error data in residual error data set as abscissa and using pixel number as ordinate in the last one is right The pixel number answered is not the abscissa positions of 0 residual error data;
Determine the range of characteristic values where the macro block characteristics value;
Obtain quantization step of the corresponding quantization step of the range of characteristic values as described image macro block;
According to the residual error data for each pixel that the quantization step and described image macro block include, to described image macro block into Row quantification treatment.
2. the method as described in claim 1, which is characterized in that it is described that prediction processing is carried out to described image macro block, obtain institute State the residual error data for each pixel that image macro includes, comprising:
Prediction processing is carried out to described image macro block respectively using a variety of prediction modes, obtains described image under every kind of prediction mode The residual error data for each pixel that macro block includes.
3. method according to claim 2, which is characterized in that each pixel for including according to described image macro block The quantization step of residual error data calculating described image macro block, comprising:
According to the residual error data for each pixel that described image macro block includes under every kind of prediction mode, count described pre- If the corresponding pixel number of each residual error data in residual error data set, calculates separately out institute under every kind of prediction mode The macro block characteristics value of image macro is stated, the macro block characteristics value is indicated when maximum pixel number is greater than 1, maximum pixel Quotient between point number and the position of acquisition, the position instruction is to preset the residual error data in residual error data set as cross Coordinate and using pixel number as ordinate in the last one corresponding pixel number be not 0 residual error data abscissa position It sets;
From maximum macro block characteristics value is selected under every kind of prediction mode in the macro block characteristics value of described image macro block;
Determine the range of characteristic values where the maximum macro block characteristics value;
Obtain quantization step of the corresponding quantization step of the range of characteristic values as described image macro block.
4. method as claimed in claim 3, which is characterized in that described to include according to the quantization step and described image macro block Each pixel residual error data, to described image macro block carry out quantification treatment, comprising:
Obtain the corresponding prediction mode of the maximum macro block characteristics value;
According to the residual error for each pixel that described image macro block includes under the quantization step and the prediction mode of the acquisition Data carry out quantification treatment to described image macro block.
5. the device that a kind of pair of picture carries out quantification treatment, which is characterized in that described device includes:
Division module obtains the image macro that the picture includes for dividing to picture;
Prediction module obtains each pixel that described image macro block includes for carrying out prediction processing to described image macro block Residual error data;
Computing module, comprising: the first computing unit, the first determination unit and first acquisition unit;
First computing unit, comprising:
Subelement is counted, for counting default residual error number from the residual error data for each pixel that described image macro block includes According to the corresponding pixel number of each residual error data for including in set;
Computation subunit, for according to the corresponding pixel number of each residual error data for including in the default residual error data set Mesh, calculates the macro block characteristics value of described image macro block, and the macro block characteristics value indicates to be greater than 1 when maximum pixel number When, the quotient between maximum pixel number and the position of acquisition, the position instruction is in default residual error data set Residual error data be abscissa and using pixel number as ordinate in the last one corresponding pixel number be not 0 residual error The abscissa positions of data;
First determination unit, for determining the range of characteristic values where the macro block characteristics value;
The first acquisition unit, for obtaining amount of the corresponding quantization step of the range of characteristic values as described image macro block Change step-length;
Quantization modules, the residual error data of each pixel for including according to the quantization step and described image macro block are right Described image macro block carries out quantification treatment.
6. device as claimed in claim 5, which is characterized in that
The prediction module is obtained specifically for carrying out prediction processing to described image macro block respectively using a variety of prediction modes The residual error data for each pixel that described image macro block includes under every kind of prediction mode.
7. device as claimed in claim 6, which is characterized in that the computing module includes:
Second computing unit, for the residual error according to each pixel that described image macro block includes under every kind of prediction mode Data count the corresponding pixel number of each residual error data in the default residual error data set, calculate separately out institute The macro block characteristics value of described image macro block under every kind of prediction mode is stated, the macro block characteristics value indicates to work as maximum pixel number When greater than 1, quotient between maximum pixel number and the position of acquisition, the position instruction is to preset residual error data collection Residual error data in conjunction be abscissa and using pixel number as ordinate in the last one corresponding pixel number be not 0 The abscissa positions of residual error data;
Selecting unit, for from selecting maximum macro block in the macro block characteristics value of described image macro block under every kind of prediction mode Characteristic value;
Second determination unit, for determining the range of characteristic values where the maximum macro block characteristics value;
Second acquisition unit is walked for obtaining the corresponding quantization step of the range of characteristic values as the quantization of described image macro block It is long.
8. device as claimed in claim 7, which is characterized in that the quantization modules include:
Third acquiring unit, for obtaining the corresponding prediction mode of the maximum macro block characteristics value;
Quantifying unit, for each of including according to described image macro block under the quantization step and the prediction mode of the acquisition The residual error data of pixel carries out quantification treatment to described image macro block.
9. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage at least one refers to It enables, realizes that any a kind of pair of picture of claim 1-4 carries out the side of quantification treatment when described instruction is executed by processor Method.
CN201510093071.5A 2015-03-02 2015-03-02 A kind of pair of picture carries out the method and device of quantification treatment Active CN105992001B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510093071.5A CN105992001B (en) 2015-03-02 2015-03-02 A kind of pair of picture carries out the method and device of quantification treatment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510093071.5A CN105992001B (en) 2015-03-02 2015-03-02 A kind of pair of picture carries out the method and device of quantification treatment

Publications (2)

Publication Number Publication Date
CN105992001A CN105992001A (en) 2016-10-05
CN105992001B true CN105992001B (en) 2019-09-20

Family

ID=57039329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510093071.5A Active CN105992001B (en) 2015-03-02 2015-03-02 A kind of pair of picture carries out the method and device of quantification treatment

Country Status (1)

Country Link
CN (1) CN105992001B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108156457B (en) * 2017-12-27 2021-10-15 郑州云海信息技术有限公司 Image coding method and device for converting JPEG (Joint photographic experts group) into WebP (Web WebP)
CN109738008B (en) * 2019-01-15 2021-01-08 深圳市对接平台科技发展有限公司 On-site resolution analysis platform
CN110300304B (en) * 2019-06-28 2022-04-12 广东中星微电子有限公司 Method and apparatus for compressing image sets
CN111923599B (en) * 2020-09-18 2021-02-26 季华实验室 Method and equipment for calculating step length of spray head module, storage medium and ink-jet printer
CN117037226B (en) * 2023-10-09 2024-02-27 深圳市聚诚智能有限公司 Optical fingerprint module and fingerprint identification display device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0884844A2 (en) * 1997-06-11 1998-12-16 Nec Corporation Adaptive filter, step size control method thereof, and record medium therefor
CN102413353A (en) * 2011-12-28 2012-04-11 清华大学 Method for allocating code rates of multi-view video and depth graph in stereo video encoding process
CN103843338A (en) * 2011-10-04 2014-06-04 汤姆逊许可公司 Adaptive quantization of intra-encoding image blocks
CN103957410A (en) * 2013-12-30 2014-07-30 南京邮电大学 I-frame code rate control method based on residual frequency domain complexity
CN104954792A (en) * 2014-03-24 2015-09-30 兴唐通信科技有限公司 Method and device for carrying out subjective video quality optimization coding on P-frame sequence

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0884844A2 (en) * 1997-06-11 1998-12-16 Nec Corporation Adaptive filter, step size control method thereof, and record medium therefor
CN103843338A (en) * 2011-10-04 2014-06-04 汤姆逊许可公司 Adaptive quantization of intra-encoding image blocks
CN102413353A (en) * 2011-12-28 2012-04-11 清华大学 Method for allocating code rates of multi-view video and depth graph in stereo video encoding process
CN103957410A (en) * 2013-12-30 2014-07-30 南京邮电大学 I-frame code rate control method based on residual frequency domain complexity
CN104954792A (en) * 2014-03-24 2015-09-30 兴唐通信科技有限公司 Method and device for carrying out subjective video quality optimization coding on P-frame sequence

Also Published As

Publication number Publication date
CN105992001A (en) 2016-10-05

Similar Documents

Publication Publication Date Title
US9591235B2 (en) Method and device for image taking brightness control and computer readable storage medium
CN105243638B (en) A kind of method and apparatus uploading image
CN106933525B (en) A kind of method and apparatus showing image
CN104978176B (en) Application programming interfaces call method, device and computer readable storage medium
CN105992001B (en) A kind of pair of picture carries out the method and device of quantification treatment
CN106371086B (en) A kind of method and apparatus of ranging
CN106203459B (en) Picture processing method and device
WO2014086218A1 (en) Interface adjustment method, device and terminal
CN104699501B (en) A kind of method and device for running application program
CN106504303B (en) A kind of method and apparatus playing frame animation
CN104021129B (en) Show the method and terminal of group picture
CN107396193B (en) The method and apparatus of video playing
CN105245432B (en) Unread message counting method and device and terminal
JP2016511875A (en) Image thumbnail generation method, apparatus, terminal, program, and recording medium
CN106296640B (en) A kind of method and apparatus identifying blurred picture
CN104915625B (en) A kind of method and device of recognition of face
CN105120158B (en) The image pickup method and device of mobile terminal
CN108564539B (en) Method and device for displaying image
CN104967864B (en) A kind of method and device merging video
CN106210838B (en) Caption presentation method and device
CN106023088B (en) A kind of method and device adjusting brightness of image
CN105513098B (en) Image processing method and device
CN105187831B (en) A kind of method and apparatus that image is compressed
CN104461485B (en) A kind of method and user equipment of forms coloring
CN104952026B (en) The method and device of image procossing

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant