CN106611432A - Picture format conversion method, device and system - Google Patents

Picture format conversion method, device and system Download PDF

Info

Publication number
CN106611432A
CN106611432A CN201510685521.XA CN201510685521A CN106611432A CN 106611432 A CN106611432 A CN 106611432A CN 201510685521 A CN201510685521 A CN 201510685521A CN 106611432 A CN106611432 A CN 106611432A
Authority
CN
China
Prior art keywords
weight table
function
mass parameter
weighted value
picture
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.)
Granted
Application number
CN201510685521.XA
Other languages
Chinese (zh)
Other versions
CN106611432B (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 CN201510685521.XA priority Critical patent/CN106611432B/en
Publication of CN106611432A publication Critical patent/CN106611432A/en
Application granted granted Critical
Publication of CN106611432B publication Critical patent/CN106611432B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/007Transform coding, e.g. discrete cosine transform

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Discrete Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

Disclosed are a picture format conversion method, device and system. In embodiments of the present invention, the quality of picture information needing to be susceptible to format conversion is detected to obtain an original encoding quality parameter, and the picture information is decoded according to the original encoding quality parameter to obtain original data; then, a corresponding weighted value is calculated according to the original encoding quality parameter and a preset weight table, and the weighted value is calculated by utilizing a preset function to obtain a target encoding quality parameter; and then, the original data is encoded according to the target encoding quality parameter to obtain a target format picture. The solution not only can improve the conversion flexibility and conversion effect thereof, but also can improve the calculation efficiency thereof.

Description

A kind of picture format conversion method, device and system
Technical field
The present invention relates to communication technical field, and in particular to a kind of picture format conversion method, device and system.
Background technology
Picture format is changed, and refers to for picture to be converted into another kind of form from a kind of form, and abbreviation picture turns Code.Wherein, common picture format includes standard image file format (BMP, Bitmap), joint figure Picture format (JPEG, Joint Photographic Experts Group), the figure formulated as panel of expert As file memory format (PNG, Portable Network Graphic Format), graphic interchange format (GIF, Graphics Interchange Format), JP2 (a kind of form of the standards of JPEG 2000) and portable Formula document format (PDF, Portable Document Format) etc..
When picture format conversion is carried out, generally require carries out coding quality detection to picture, to determine picture Coding quality Q1, then picture is decoded according to coding quality Q1, obtain original YUV A kind of (YCrCb, colour coding method) data, the original yuv data is compiled according to preset target Code quality Q 2 is encoded, and just can obtain object format picture.Wherein, coding matter is being carried out to picture During amount detection, various ways can be adopted, for example, by taking JPEG picture as an example, in the prior art, one As need for JPEG picture coding quality parameter 1-100, precompute the quantization table of each quality QTable1 to QTable100, wherein, each quantifies 64 parameters of table, then, decodes JPEG picture File header, obtain the quantization table QTtableX of original JPEG picture, and in QTable1 to QTable100 Central lookup quantifies table with QTtableX matching degrees highest, such as QTableN then can determine that X=N, Namely the coding parameter of the JPEG picture is N, so as to obtain the coding quality of the JPEG picture.
In the research and practice process to prior art, it was found by the inventors of the present invention that in existing scheme, If Q1 is than larger, and Q2 is far smaller than Q1, then can cause mass loss after high-quality picture transcoding The occurrence of big, and if Q1 is smaller, Q2 is far longer than Q1, then picture volume will after transcoding Can become big, waste the network bandwidth, therefore, conversion effect is not good;It is additionally, since existing by quantization table Determining the method for original coding mass parameter has certain complexity, such as, be with 64 parameters of each table Example, then 100 tables just have 6400 parameters, and these parameters need to be compared one by one the matter that can just draw picture Amount, so computational efficiency is also than relatively low.
The content of the invention
The embodiment of the present invention provides a kind of picture format conversion method, device and system, can improve conversion effect Really, and improve computational efficiency.
The embodiment of the present invention provides a kind of picture format conversion method, including:
Acquisition needs the pictorial information into row format conversion;
Quality testing is carried out to the pictorial information, original coding mass parameter is obtained;
The pictorial information is decoded according to the original coding mass parameter, obtains initial data;
Corresponding weighted value is calculated according to the original coding mass parameter and preset weight table;
Using preset function, the weighted value is calculated, obtain target code mass parameter;
The initial data is encoded according to the target code mass parameter, obtains object format figure Piece.
Accordingly, the embodiment of the present invention also provides a kind of picture format conversion equipment, including:
Acquiring unit, for obtaining the pictorial information needed into row format conversion;
Detector unit, for carrying out quality testing to the pictorial information, obtains original coding mass parameter;
Decoding unit, for being decoded to the pictorial information according to the original coding mass parameter, obtains To initial data;
First arithmetic element, for corresponding with preset weight table calculating according to the original coding mass parameter Weighted value;
Second arithmetic element, for utilizing preset function, calculates the weighted value, obtains target volume Code mass parameter;
Coding unit, for being encoded to the initial data according to the target code mass parameter, obtains To object format picture.
Additionally, the embodiment of the present invention also provides a kind of picture format converting system, including the embodiment of the present invention is carried For any one picture format conversion equipment.
The embodiment of the present invention is by needing the pictorial information into row format conversion to carry out quality testing, obtaining original Beginning coding quality parameter, then, on the one hand solves according to the original coding mass parameter to the pictorial information Code, to obtain initial data, on the other hand, according to the original coding mass parameter and preset weights meter Corresponding weighted value is calculated, and the weighted value is calculated using preset function, obtain target code quality ginseng Number, subsequently, encodes according to the target code mass parameter to the initial data, obtains object format Picture;Because the program is in transcoding, can according to the corresponding weighted value of original coding mass parameter of picture, And preset function calculates target code mass parameter, and the preset function can be according to practical application Demand be adjusted, for prior art, the program can realize coding quality from Adjustment is adapted to, can both realize that high-quality original image wished to retain the purpose of picture quality in transcoding, Can realize that low quality original image wishes to reduce the volume of picture to save wanting for the network bandwidth in transcoding Ask, substantially increase motility and the conversion effect of its conversion;The program is additionally, since to pictorial information When carrying out quality testing, and its parameter need not one by one be compared, but directly be calculated corresponding weighting Value, therefore, its complexity is greatly reduced, its computational efficiency can be improved.
Description of the drawings
Technical scheme in order to be illustrated more clearly that the embodiment of the present invention, below will be to institute in embodiment description The accompanying drawing that needs are used is briefly described, it should be apparent that, drawings in the following description are only the present invention Some embodiments, for those skilled in the art, on the premise of not paying creative work, also Other accompanying drawings can be obtained according to these accompanying drawings.
Fig. 1 a are the schematic diagram of a scenario of picture format converting system provided in an embodiment of the present invention;
Fig. 1 b are the flow charts of picture format conversion method provided in an embodiment of the present invention;
Fig. 2 a are another flow charts of picture format conversion method provided in an embodiment of the present invention;
Fig. 2 b are weighted value and coding quality parameters in picture format conversion method provided in an embodiment of the present invention Relation schematic diagram;
Fig. 3 a are the structural representations of picture format conversion equipment provided in an embodiment of the present invention;
Fig. 3 b are another structural representations of picture format conversion equipment provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clearly Chu, it is fully described by, it is clear that described embodiment is only a part of embodiment of the invention, rather than Whole embodiments.Based on the embodiment in the present invention, those skilled in the art are not making creative labor The every other embodiment obtained under the premise of dynamic, belongs to the scope of protection of the invention.
The embodiment of the present invention provides a kind of picture format conversion method, device and system.
Wherein, the picture format converting system can include any one picture lattice that the embodiment of the present invention is provided Formula conversion equipment, the picture format conversion equipment can exist as independent entity, it is also possible to integrated or peace Other equipment are mounted in, such as in terminal.
For example, as a example by be integrated in terminal, referring to Fig. 1 a, when needing to enter picture row format conversion, than Such as, when receiving the picture format convert requests of user's triggering, the terminal can be obtained to be needed into row format to turn The pictorial information for changing, then, to the pictorial information quality testing is carried out, and obtains original coding mass parameter, And the pictorial information is decoded according to the original coding mass parameter, obtain initial data, and according to The original coding mass parameter and preset weight table calculate corresponding weighted value, subsequently, using preset letter Number, calculates the weighted value, obtains target code mass parameter, and according to the target code quality ginseng It is several that the initial data is encoded, object format picture is just obtained.Wherein, the preset function can be with Flexibly set according to the demand of practical application.
Additionally, the picture format converting system can also include other equipment, such as input equipment, such as key Disk and mouse etc., and storage device etc..
To be described in detail respectively below.
Embodiment one,
The present embodiment will be described from the angle of picture format conversion equipment, the picture format conversion equipment tool Body can be integrated in the equipment such as terminal, it is also possible to installed in the terminal in the form of terminal applies.
A kind of picture format conversion method, including:Acquisition needs the pictorial information into row format conversion, to this Pictorial information carries out quality testing, obtains original coding mass parameter;According to the original coding mass parameter pair The pictorial information is decoded, and obtains initial data;According to the original coding mass parameter and preset weights Meter calculates corresponding weighted value;Using preset function, the weighted value is calculated, obtain target code matter Amount parameter;The initial data is encoded according to the target code mass parameter, obtains object format picture.
As shown in Figure 1 b, the idiographic flow of the picture format conversion method can be as follows:
101st, the pictorial information needed into row format conversion is obtained.
For example, the picture format convert requests that specifically can be triggered with receive user, wherein, the picture format turns Change in request and carry the pictorial information needed into row format conversion.
Or, and for example, it is also possible to receive user triggering picture format convert requests, wherein, the picture Format conversion request is carried needs the picture identification into row format conversion or address, according to the picture identification or ground Location obtains corresponding pictorial information, etc..
102nd, quality testing is carried out to the pictorial information, obtains original coding mass parameter.
Wherein, the form of expression of the original coding mass parameter can have various, such as, and can be by quantifying Table showing, i.e. step " quality testing being carried out to the pictorial information, obtain original coding mass parameter " tool Body can be as follows:
For example, the pictorial information can be parsed, obtains correspondence quantization table, such as, be included with the pictorial information As a example by the information such as brightness and/or colourity, specifically can be as follows:
The header of the pictorial information is parsed, luminance quantization table is obtained;And/or,
The header of the pictorial information is parsed, chromaticity quantization table is obtained.
Wherein, the quantization table can adopt matrix, such as meet the matrix of the first form to represent, wherein, should First form can be configured according to the demand of practical application, such as, can be the matrix of 8*8, as follows:
0x2 0x1 0x1 0x2 0x2 0x4 0x5 0x6
0x1 0x1 0x1 0x2 0x3 0x6 0x6 0x6
0x1 0x1 0x2 0x2 0x4 0x6 0x7 0x6
0x1 0x2 0x2 0x3 0x5 0x9 0x8 0x6
0x2 0x2 0x4 0x6 0x7 0xB 0xA 0x8
0x2 0x4 0x6 0x6 0x8 0xA 0xB 0x9
0x5 0x6 0x8 0x9 0xA 0xC 0xC 0xA
0x7 0x9 0xA 0xA 0xB 0xA 0xA 0xA
103rd, the pictorial information is decoded according to the original coding mass parameter, obtains initial data.
Depending on specific decoding process can be according to coded system, such as, if the unprocessed form of the picture is JPEG, then now can be decoded in the relative decoding mode using JPEG to the JPEG picture, or, If the unprocessed form of the picture is GIF, now can with using the relative decoding mode of GIF to GIF figure Piece carries out decoding, etc., will not be described here.
104th, corresponding weighted value is calculated according to the original coding mass parameter and preset weight table.
Wherein, the weight table can be configured according to the demand of practical application, the weights tableau format with amount Change tableau format to be adapted, such as, it is also possible to be set to meet the matrix of the first form such as 8*8, wherein, In order to reduce multiplying, the weights in the weight table can be represented using 2 n powers, n be more than etc. It is as follows in 0 positive integer:
2^14 2^13 2^12 2^11 2^10 2^9 2^8 2^7
2^13 2^12 2^11 2^10 2^9 2^8 2^7 2^6
2^12 2^11 2^10 2^9 2^8 2^7 2^6 2^5
2^11 2^10 2^9 2^8 2^7 2^6 2^5 2^4
2^10 2^9 2^8 2^7 2^6 2^5 2^4 2^3
2^9 2^8 2^7 2^6 2^5 2^4 2^3 2^2
2^8 2^7 2^6 2^5 2^4 2^3 2^2 2^1
2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
Then now, step " calculates corresponding weighting according to the original coding mass parameter and preset weight table Value " specifically can be as follows:
The element in the quantization table is multiplied respectively with the element of relevant position in preset weight table respectively, Corresponding product is obtained, the sum of all products is calculated, corresponding weighted value is obtained.
It should be noted that, if including multiple parameters in the pictorial information, can by these parameters according to Which calculates respectively its corresponding weighted value, such as, with the pictorial information brightness and/or colourity etc. are included As a example by information, then specifically can be as follows:
The element in luminance quantization table is entered respectively with the element of relevant position in preset brightness weight table respectively Row is multiplied, and obtains corresponding product, calculates the sum of all products, obtains corresponding brightness weights;With/ Or,
The element in chromaticity quantization table is entered respectively with the element of relevant position in preset colourity weight table respectively Row is multiplied, and obtains corresponding product, calculates the sum of all products, obtains corresponding colourity weighted value.
Wherein, the weight table can be set in advance in the picture format conversion equipment, it is also possible to by user's root Voluntarily it is configured or adjusts according to business demand, i.e., in step " according to the original coding mass parameter and preset Weight table calculate corresponding weighted value " before, the picture format conversion method can also include:
Weight table is set so that the weights in the weight table from left to right and from top to bottom successively decrease successively, Optionally, in order to reduce operand, the weights in the weight table can use Arbitrary Digit n powers, such as 2 N powers representing, wherein, n is the positive integer more than or equal to 0.For example, the method for the setting weight table Specifically can be as follows:
The all coding quality parameters in presetting range are obtained, for each coding quality parameter weights are calculated, And the mapping relations one by one of weights and each coding quality parameter are set up, the mapping relations are saved as into weights Table.
Wherein, step " calculates weights, and sets up weights and each coding for each coding quality parameter The mapping relations one by one of mass parameter " can include:
The corresponding quantization table of each quality is calculated according to coding quality parameter, for the corresponding quantization of each quality Meter calculates weights, and sets up the mapping relations one by one of the corresponding quantization table of weights and this each quality.
It should be noted that, if the pictorial information includes multiple parameters, such as brightness and/or colourity etc., Then one unified weight table can be set for this multiple parameters, or it is right that this multiple parameters is respectively provided with The weight table answered, such as brightness weight table and/or colourity weight table etc., this multiple weight table can be identical , or it is different, specifically can be according to the demand of practical application depending on, will not be described here.
105th, preset function is utilized, the weighted value is calculated, obtain target code mass parameter.
Wherein, the preset function can be configured according to the demand of practical application, such as, work as original coding When mass parameter Q1 is less than 80, can adopt can make target code mass parameter Q1' be equal to the original coding The function of mass parameter Q1 (i.e. Q1'=Q1) ensureing the compression ratio of low-quality picture, or when original When beginning coding quality parameter Q1 is more than 80, then can be higher using be equal to can target code mass parameter Value, detailed information of picture, etc. is retained such as the function of " Q1'=80 " or " Q1'=90 ", should Be understood by, above are only example, however it is not limited to Q1'=Q1, Q1'=80 or Q1'=90, or " Q1'=f (Q1) ", will not be described here.
Optionally, multiple functions can also be set, voluntarily selected for user, i.e., step " utilize preset function, The weighted value is calculated, target code mass parameter is obtained " specifically can be as follows:
The function of receive user selects request, selects request to select from preset function set according to the function Function, using the function of selection, calculates the weighted value, obtains target code mass parameter.
It should be noted that, if the pictorial information includes multiple parameters, such as brightness and/or colourity etc., Then one unified function can be set for this multiple parameters, or this multiple parameters is respectively provided with correspondence Function, such as first function and/or second function etc. are as follows:
Using preset first function, the brightness weights are calculated, obtain object brightness quantization table;With / or,
Using preset second function, the colourity weighted value is calculated, obtain target colorimetric quantization table;
Then now, step " encodes to the initial data according to the target code mass parameter, obtains mesh Mark format picture " is specifically as follows:
The initial data is encoded according to the object brightness quantization table, and/or target colorimetric quantization table, Obtain object format picture.
Optionally, the function can be to be voluntarily configured or be adjusted, i.e., in step " using preset by user Function, calculates the weighted value, obtains target code mass parameter " before, the picture format conversion Method can also include:
The function setup request of user is obtained, function is configured according to the function setup request.
106th, the initial data is encoded according to the target code mass parameter, obtains object format figure Piece.
For example, if necessary to the picture is converted into into GIF forms, then now can be according to the target code matter Amount parameter carries out GIF codings to the initial data, obtains object format picture, etc..
From the foregoing, it will be observed that the present embodiment carries out quality testing by the pictorial information to needing to be changed into row format, Original coding mass parameter is obtained, then, on the one hand according to the original coding mass parameter to the pictorial information Decoded, to obtain initial data, on the other hand, according to the original coding mass parameter and preset power Value meter calculates corresponding weighted value, and the weighted value is calculated using preset function, obtains target code Mass parameter, subsequently, encodes according to the target code mass parameter to the initial data, obtains mesh Mark format picture;Because the program is in transcoding, can be corresponding according to the original coding mass parameter of picture Weighted value, and preset function calculating target code mass parameter, and the preset function can basis The demand of practical application is adjusted, and for prior art, the program can realize coding The self-adaptative adjustment of quality, can both realize that high-quality original image wished to retain picture quality in transcoding Purpose, it is also possible to realize that low quality original image wishes the volume for reducing picture to save Netowrk tape in transcoding Wide requirement, substantially increases motility and the conversion effect of its conversion;The program is additionally, since to figure When piece information carries out quality testing, and its parameter need not one by one be compared, but directly be calculated corresponding Weighted value, therefore, greatly reduce its complexity, its computational efficiency can be improved.
Embodiment two,
Method according to described by embodiment one, is below described in further detail citing.
In the present embodiment, will with the picture format conversion equipment it is concrete it is integrated in the terminal, and picture tool Body is to illustrate as a example by JPEG picture.
As shown in Figure 2 a, a kind of picture format conversion method, idiographic flow can be as follows:
201st, the picture format convert requests of terminal receive user triggering, wherein, the picture format conversion please Middle carrying is asked to need the pictorial information of the JPEG picture into row format conversion.
202nd, the terminal-pair pictorial information carries out quality testing, obtains original coding mass parameter.
For example, by taking brightness as an example, then the brightness of the JPEG picture specifically can be determined according to the pictorial information, Then parse the brightness, obtain luminance quantization table, such as, and by taking the luminance quantization table matrix X of quality 95 as an example, Then can be as follows:
0x2 0x1 0x1 0x2 0x2 0x4 0x5 0x6
0x1 0x1 0x1 0x2 0x3 0x6 0x6 0x6
0x1 0x1 0x2 0x2 0x4 0x6 0x7 0x6
0x1 0x2 0x2 0x3 0x5 0x9 0x8 0x6
0x2 0x2 0x4 0x6 0x7 0xB 0xA 0x8
0x2 0x4 0x6 0x6 0x8 0xA 0xB 0x9
0x5 0x6 0x8 0x9 0xA 0xC 0xC 0xA
0x7 0x9 0xA 0xA 0xB 0xA 0xA 0xA
203rd, terminal is decoded according to the original coding mass parameter to the pictorial information of the JPEG picture, Obtain initial data.
Depending on specific decoding process can be according to coded system, such as, can now adopt the phase of JPEG Close decoding process carries out decoding, etc. to the JPEG picture, will not be described here.
204th, corresponding weighted value is calculated according to the original coding mass parameter and preset weight table.
Wherein, the weight table can be configured according to the demand of practical application, such as, for the one of picture Individual 8*8 macro blocks, in the frequency domain after discrete cosine transform, upper left position is the DC component of picture, Impact to picture is maximum, and from left to right, from top to bottom, frequency component is according to gradually arranging from low to high Cloth, the impact to picture effect seen by person also progressively diminishes, therefore, these features can be directed to, set up The form of one weight table Y, weight table Y is adapted with tableau format is quantified, such as, it is also possible to arrange To meet the matrix of the first form such as 8*8, wherein, the weights in order to reduce multiplying, in the weight table Can be represented using 2 n powers, n is the positive integer more than or equal to 0, as follows:
2^14 2^13 2^12 2^11 2^10 2^9 2^8 2^7
2^13 2^12 2^11 2^10 2^9 2^8 2^7 2^6
2^12 2^11 2^10 2^9 2^8 2^7 2^6 2^5
2^11 2^10 2^9 2^8 2^7 2^6 2^5 2^4
2^10 2^9 2^8 2^7 2^6 2^5 2^4 2^3
2^9 2^8 2^7 2^6 2^5 2^4 2^3 2^2
2^8 2^7 2^6 2^5 2^4 2^3 2^2 2^1
2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
Then now, step " calculates corresponding weighting according to the original coding mass parameter and preset weight table Value " specifically can be as follows:
Table will be quantified respectively, such as the element in luminance quantization Table X in step 203 and phase in weight table Y The element for answering position is multiplied respectively, obtains corresponding product, calculates the sum of all products, obtains correspondence Weighted value.I.e.:
By the first row first row in the element of the first row first row in the luminance quantization Table X and weight table Y Element is multiplied, and obtains the corresponding product of the first row first row;
By the first row secondary series in the element of the first row secondary series in the luminance quantization Table X and weight table Y Element is multiplied, and obtains the corresponding product of the first row secondary series;
The tertial element of the first row in the luminance quantization Table X is tertial with the first row in weight table Y Element is multiplied, and is obtained the first row the 3rd and is arranged corresponding product;
……
By the second row first row in the element of the second row first row in the luminance quantization Table X and weight table Y Element is multiplied, and obtains the corresponding product of the second row first row;
……
By the element of the row of the 8th row the 8th in the luminance quantization Table X and the row of the 8th row the 8th in weight table Y Element is multiplied, and is obtained the 8th row the 8th and is arranged corresponding product.
By that analogy, " 8*8=64 " individual product is obtained, then, this 64 products is added, just may be used The corresponding weighted value of brightness is obtained, such as, after above-mentioned X is multiplied and is added with Y, is obtained 109918, The as weighted value of quality 95, the weights also represent to a certain extent the coding quality of the JPEG picture, Such as, referring to Fig. 2 b, can see from Fig. 2 b, 100 weighted values calculated using the weight table, The strictly decreasing when coding quality parameter becomes big, the characteristics of meet strictly monotone.
It should be noted that, if including multiple parameters in the pictorial information, can by these parameters according to Which calculates respectively its corresponding weighted value, such as the corresponding weighted value of brightness and/or colourity add accordingly Weights etc..
It should be noted that, the setting of the weight table is not limited to shown in above-mentioned example, it should be appreciated that Can be other patterns or other weights, as long as setting up one between coding of graphics quality and the weighted value It is individual to map one by one, and the mapping is dull, and the concrete method to set up of weight table Y can be found in reality Example one is applied, be will not be described here.
205th, the function of terminal receive user selects request, and terminal selects request from preset according to the function Function is selected in function set.
Wherein, the function set at least includes a function, and the function can enter according to the demand of practical application Row is arranged.Optionally, the function can be concrete to obtain to be voluntarily configured or be adjusted by user, such as The function setup request of user, then function is configured according to the function setup request, etc..
206th, terminal is calculated the weighted value using the function of selection, obtains target code quality ginseng Number.
207th, terminal is encoded according to the target code mass parameter to the initial data, obtains target lattice Formula picture.
For example, if necessary to the JPEG picture is converted into into GIF forms, then now can be compiled according to the target Code mass parameter carries out GIF codings to the initial data, obtains object format picture, etc..
From the foregoing, it will be observed that the present embodiment carries out quality testing by the pictorial information to JPEG picture, original is obtained Beginning coding quality parameter, then, on the one hand solves according to the original coding mass parameter to the pictorial information Code, to obtain initial data, on the other hand, according to the original coding mass parameter and preset weights meter Corresponding weighted value is calculated, and the weighted value is calculated using preset function, obtain target code quality ginseng Number, subsequently, encodes according to the target code mass parameter to the initial data, obtains object format Picture;Because the program is in transcoding, can according to the corresponding weighted value of original coding mass parameter of picture, And preset function calculates target code mass parameter, and the preset function can be according to practical application Demand be adjusted, for prior art, the program can realize coding quality from Adjustment is adapted to, can both realize that high-quality original image wished to retain the purpose of picture quality in transcoding, Can realize that low quality original image wishes to reduce the volume of picture to save wanting for the network bandwidth in transcoding Ask, substantially increase motility and the conversion effect of its conversion, improve Consumer's Experience;It is additionally, since the party Case need not one by one be compared its parameter when quality testing is carried out to pictorial information, but directly Corresponding weighted value is calculated, therefore, its complexity is greatly reduced, its computational efficiency can be improved.
Embodiment three,
In order to preferably implement above method, the embodiment of the present invention also provides a kind of picture format conversion equipment, As shown in Figure 3 a, the picture format conversion equipment can include acquiring unit 301, detector unit 302, decoding Unit 303, the first arithmetic element 304, the second arithmetic element 305 and coding unit 306, it is as follows:
(1) acquiring unit 301;
Acquiring unit 301, for obtaining the pictorial information needed into row format conversion.
For example, acquiring unit 301, the picture format convert requests that specifically can be triggered with receive user, wherein, The pictorial information needed into row format conversion is carried in the picture format convert requests.
Or, and for example, acquiring unit 301, the picture format conversion that specifically can be triggered with receive user please Ask, wherein, the picture format convert requests are carried needs the picture identification into row format conversion or address, root According to the picture identification or the corresponding pictorial information of address acquisition, etc..
(2) detector unit 302;
Detector unit 302, for carrying out quality testing to the pictorial information, obtains original coding mass parameter.
For example, the detector unit 302, specifically can be used for parsing the pictorial information, obtain correspondence quantization table, Such as, so that the pictorial information includes the information such as brightness and/or colourity as an example, specifically can be as follows:
The brightness of picture is determined according to the pictorial information, the brightness is parsed, luminance quantization table is obtained;And/or,
The colourity of picture is determined according to the pictorial information, the colourity is parsed, chromaticity quantization table is obtained.
Wherein, the quantization table can adopt matrix, such as meet the matrix of the first form to represent, specifically can join See embodiment above, will not be described here.
(3) decoding unit 303;
Decoding unit 303, for being decoded to the pictorial information according to the original coding mass parameter, obtains To initial data.
(4) first arithmetic elements 304;
First arithmetic element 304, for calculating right according to the original coding mass parameter and preset weight table The weighted value answered.
Wherein, the weight table can be configured according to the demand of practical application, the weights tableau format with amount Change tableau format to be adapted, such as, it is also possible to be set to meet the matrix of the first form such as 8*8, wherein, In order to reduce multiplying, the weights in the weight table can be represented using 2 n powers, n be more than etc. In 0 positive integer, embodiment of the method above is referred to, be will not be described here.
If the weight table is the matrix for closing the first form,:
First arithmetic element 304, specifically can be used for not by the element in the quantization table and preset weight table The element of relevant position is multiplied respectively, obtains corresponding product, calculates the sum of all products, obtains right The weighted value answered.
It should be noted that, if including multiple parameters in the pictorial information, can by these parameters according to Which calculates respectively its corresponding weighted value, such as, with the pictorial information brightness and/or colourity etc. are included As a example by information, then the first arithmetic element 304 can specifically perform following operation:
The element in luminance quantization table is entered respectively with the element of relevant position in preset brightness weight table respectively Row is multiplied, and obtains corresponding product, calculates the sum of all products, obtains corresponding brightness weights;With/ Or,
The element in chromaticity quantization table is entered respectively with the element of relevant position in preset colourity weight table respectively Row is multiplied, and obtains corresponding product, calculates the sum of all products, obtains corresponding colourity weighted value.
(5) second arithmetic elements 305;
Second arithmetic element 305, for utilizing preset function, calculates the weighted value, obtains target Coding quality parameter.
Wherein, the preset function can be configured according to the demand of practical application, and the function can be one, Can also be multiple, be selected by user again when using, i.e.,:
Second arithmetic element 305, the function that specifically can be used for receive user selects request, according to the letter Number selects request to select function from preset function set, using the function of selection, the weighted value is carried out Calculate, obtain target code mass parameter.
(6) coding unit 306;
Coding unit 306, for being encoded to the initial data according to the target code mass parameter, obtains To object format picture.
Wherein, weight table can be set in advance in the picture format conversion equipment, it is also possible to by user according to Business demand is voluntarily configured or adjusts, i.e., as shown in Figure 3 b, the picture format conversion equipment can also be wrapped Setting unit 307 is included, it is as follows:
Setting unit 307, for arranging weight table so that the weights in the weight table from left to right and Successively decrease successively from top to bottom.
Optionally, in order to reduce operand, the weights in the weight table can use the n powers of Arbitrary Digit, Such as 2 n powers representing, i.e.,:
The setting unit 307, specifically can be used for arranging weight table so that the weights in the weight table are from a left side Successively decrease to the right side and successively from top to bottom, the weights in the weight table are represented using 2 n powers, and n is Positive integer more than or equal to 0.
Wherein, arranging the mode of the weight table can have various, for example, can be as follows:
Setting unit 307, specifically can be used for obtaining all coding quality parameters in presetting range;For Each coding quality parameter calculates weights, and sets up the pass of mapping one by one of weights and each coding quality parameter System;The mapping relations are saved as into weight table.
It should be noted that, if the pictorial information includes multiple parameters, such as brightness and/or colourity etc., Then setting unit 307 can arrange a unified weight table for this multiple parameters, or this multiple ginseng Number is respectively provided with corresponding weight table, such as brightness weight table and/or colourity weight table etc., this multiple weights Table can be identical, or different, specifically can be according to the demand of practical application depending on, here is not Repeat again.
Additionally, optional, the functional relationship between weighted value and target code mass parameter can also be by user It is configured, i.e.,:
The setting unit 307, can be also used for obtaining the function setup request of user, according to the function setup Request is configured to function.
The picture format conversion equipment specifically can be integrated in the equipment such as terminal, it is also possible to terminal applies Form is installed in the terminal.
When being embodied as, above unit can be realized as independent entity, it is also possible to be carried out arbitrarily Combination, realizes as same or several entities, and being embodied as of above unit can be found in above Embodiment of the method, will not be described here.
In addition, when implementing, field programmable gate array (FPGA, Field- can be adopted Programmable Gate Array) as central processing unit (CPU, Central Processing Unit) Coprocessor, transcoding IP (Internet protocol, the Internet due to multiple executed in parallel can be placed in FPGA Protocol) core, it is separate between each transcoding IP kernel, so, can with complete parallel transcoding, therefore Very high transcoding performance can be obtained.Simultaneously as the programmable features of FPGA, each transcoding IP kernel can be with Realize the transcoding of different target form.
From the foregoing, it will be observed that the detector unit 302 of the picture format conversion equipment of the present embodiment can be carried out to needs Form conversion pictorial information carry out quality testing, obtain original coding mass parameter, then, on the one hand by Decoding unit 303 is decoded according to the original coding mass parameter to the pictorial information, to obtain original number According on the other hand, by the first arithmetic element 304 according to the original coding mass parameter and preset weight table Corresponding weighted value is calculated, and by the second arithmetic element 305 weighted value is calculated using preset function, Target code mass parameter is obtained, subsequently, by coding unit 306 according to the target code mass parameter pair The initial data is encoded, and obtains object format picture;Because the program is in transcoding, can be according to figure The corresponding weighted value of original coding mass parameter of piece, and preset function calculating target code quality ginseng Number, and the preset function can be adjusted according to the demand of practical application, accordingly, with respect to existing For technology, the program can realize the self-adaptative adjustment of coding quality, can both realize high-quality original graph Piece wishes the purpose for retaining picture quality in transcoding, it is also possible to realize that low quality original image is wished in transcoding Hope that the volume for reducing picture, to save the requirement of the network bandwidth, substantially increases the motility and conversion of its conversion Effect;The program is additionally, since when quality testing is carried out to pictorial information, and its parameter need not be entered Row compares one by one, but directly calculates corresponding weighted value, therefore, its complexity is greatly reduced, can be with Improve its computational efficiency.
Example IV,
Additionally, the embodiment of the present invention also provides a kind of picture format converting system, including the embodiment of the present invention is carried For any one picture format conversion equipment, specifically can be found in embodiment three, for example, can be as follows:
Picture format conversion equipment, for obtaining the pictorial information needed into row format conversion, to the picture letter Breath carries out quality testing, obtains original coding mass parameter;According to the original coding mass parameter to the picture Information is decoded, and obtains initial data;Calculated according to the original coding mass parameter and preset weight table Corresponding weighted value;Using preset function, the weighted value is calculated, obtain target code mass parameter; The initial data is encoded according to the target code mass parameter, obtains object format picture.
For example, the picture format conversion equipment, specifically can be used for parsing the pictorial information, obtain corresponding amount Change table, respectively the element in the quantization table is carried out into respectively phase with the element of relevant position in preset weight table Take advantage of, obtain corresponding product, calculate the sum of all products, obtain corresponding weighted value.
Additionally, the picture format converting system can also include other equipment, such as input equipment or storage Equipment etc., it is as follows:
Input equipment, for the pictorial information needed into row format conversion of receiving user's input, and by the figure Piece information is sent to the picture format conversion equipment.
Storage device, for storing pictorial information.
More than each equipment be embodied as can be found in embodiment above, will not be described here.
Because the picture format converting system can include any one picture format provided in an embodiment of the present invention Conversion equipment, it is thereby achieved that any one picture format conversion equipment institute energy provided in an embodiment of the present invention The beneficial effect of realization, refers to preceding embodiment, will not be described here.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment Suddenly can be by program to instruct the hardware of correlation to complete, the program can be stored in a computer-readable In storage medium, storage medium can include:Read only memory (ROM, Read Only Memory), Random access memory (RAM, Random Access Memory), disk or CD etc..
A kind of picture format conversion method, device and the system for being provided the embodiment of the present invention above is carried out It is discussed in detail, specific case used herein is set forth to the principle and embodiment of the present invention, with The explanation of upper embodiment is only intended to help and understands the method for the present invention and its core concept;Simultaneously for this The technical staff in field, according to the thought of the present invention, has change in specific embodiments and applications Become part, in sum, this specification content should not be construed as limiting the invention.

Claims (16)

1. a kind of picture format conversion method, it is characterised in that include:
Acquisition needs the pictorial information into row format conversion;
Quality testing is carried out to the pictorial information, original coding mass parameter is obtained;
The pictorial information is decoded according to the original coding mass parameter, obtains initial data;
Corresponding weighted value is calculated according to the original coding mass parameter and preset weight table;
Using preset function, the weighted value is calculated, obtain target code mass parameter;
The initial data is encoded according to the target code mass parameter, obtains object format figure Piece.
2. method according to claim 1, it is characterised in that the weight table is to meet the first form Matrix, then it is described that quality testing is carried out to the pictorial information, obtain original coding mass parameter, including:
The pictorial information is parsed, correspondence quantization table is obtained, the quantization table is the matrix for meeting the first form;
It is described according to the original coding mass parameter and preset weight table calculates corresponding weighted value, specifically For:Respectively the element in the quantization table is carried out into respectively phase with the element of relevant position in preset weight table Take advantage of, obtain corresponding product, calculate the sum of all products, obtain corresponding weighted value.
3. method according to claim 1, it is characterised in that described according to the original coding quality Parameter and preset weight table are calculated before corresponding weighted value, are also included:
Weight table is set so that the weights in the weight table from left to right and from top to bottom successively decrease successively.
4. method according to claim 3, it is characterised in that the setting weight table, including:
Obtain all coding quality parameters in presetting range;
Weights are calculated for each coding quality parameter, and sets up weights with each coding quality parameter Mapping relations one by one;
The mapping relations are saved as into weight table.
5. method according to claim 4, it is characterised in that described for each coding quality parameter Calculating weights, and the mapping relations one by one of weights and each coding quality parameter are set up, including:
The corresponding quantization table of each quality is calculated according to coding quality parameter;
Weights are calculated for the corresponding meter that quantifies of each quality, and it is corresponding with described each quality to set up weights Quantify the mapping relations one by one of table.
6. method according to claim 3, it is characterised in that
Weights in the weight table represent that n is the positive integer more than or equal to 0 using 2 n powers
7. the method according to any one of claim 1 to 6, it is characterised in that described using preset letter Number, calculates the weighted value, before obtaining target code mass parameter, also includes:
Obtain the function setup request of user;
Function is configured according to function setup request.
8. the method according to any one of claim 1 to 6, it is characterised in that described using preset letter Number, calculates the weighted value, obtains target code mass parameter, including:
The function of receive user selects request;
Request is selected to select function from preset function set according to the function;
Using the function of selection, the weighted value is calculated, obtain target code mass parameter.
9. a kind of picture format conversion equipment, it is characterised in that include:
Acquiring unit, for obtaining the pictorial information needed into row format conversion;
Detector unit, for carrying out quality testing to the pictorial information, obtains original coding mass parameter;
Decoding unit, for being decoded to the pictorial information according to the original coding mass parameter, obtains To initial data;
First arithmetic element, for corresponding with preset weight table calculating according to the original coding mass parameter Weighted value;
Second arithmetic element, for utilizing preset function, calculates the weighted value, obtains target volume Code mass parameter;
Coding unit, for being encoded to the initial data according to the target code mass parameter, obtains To object format picture.
10. device according to claim 9, it is characterised in that the weight table is to meet the first lattice The matrix of formula, then:
The detector unit, specifically for parsing the pictorial information, obtains correspondence quantization table, the quantization Table is the matrix for meeting the first form;
First arithmetic element, specifically for respectively by element and the preset weight table in the quantization table The element of relevant position is multiplied respectively, obtains corresponding product, calculates the sum of all products, obtains right The weighted value answered.
11. devices according to claim 9, it is characterised in that also including setting unit;
The setting unit, for arranging weight table, obtain weights in the weight table from left to right and Successively decrease successively from top to bottom.
12. devices according to claim 11, it is characterised in that
The setting unit, specifically for arrange weight table so that the weights in the weight table from left to right, And successively decrease successively from top to bottom, the weights in the weight table are represented using 2 n powers, n be more than Positive integer equal to 0.
13. devices according to claim 11, it is characterised in that
The setting unit, specifically for obtaining all coding quality parameters in presetting range;For each Coding quality parameter calculates weights, and sets up the pass of mapping one by one of weights and each coding quality parameter System;The mapping relations are saved as into weight table.
14. devices according to any one of claim 9 to 13, it is characterised in that
The setting unit, is additionally operable to obtain the function setup request of user;Asked according to the function setup Function is configured.
15. devices according to any one of claim 9 to 13, it is characterised in that
Second arithmetic element, specifically for the function of receive user request is selected;Selected according to the function Select request and select function from preset function set;Using the function of selection, the weighted value is counted Calculate, obtain target code mass parameter.
16. a kind of picture format converting systems, it is characterised in that including appointing described in claim 9 to 15 A kind of picture format conversion equipment.
CN201510685521.XA 2015-10-21 2015-10-21 Picture format conversion method, device and system Active CN106611432B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510685521.XA CN106611432B (en) 2015-10-21 2015-10-21 Picture format conversion method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510685521.XA CN106611432B (en) 2015-10-21 2015-10-21 Picture format conversion method, device and system

Publications (2)

Publication Number Publication Date
CN106611432A true CN106611432A (en) 2017-05-03
CN106611432B CN106611432B (en) 2020-09-04

Family

ID=58610913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510685521.XA Active CN106611432B (en) 2015-10-21 2015-10-21 Picture format conversion method, device and system

Country Status (1)

Country Link
CN (1) CN106611432B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018196502A1 (en) * 2017-04-27 2018-11-01 腾讯科技(深圳)有限公司 Method and device for image transcoding
CN112887608A (en) * 2021-01-27 2021-06-01 维沃移动通信有限公司 Image processing method and device, image processing chip and electronic equipment
CN113486939A (en) * 2021-06-30 2021-10-08 平安证券股份有限公司 Method, device, terminal and storage medium for processing pictures
CN113486939B (en) * 2021-06-30 2024-07-09 平安证券股份有限公司 Picture processing method, device, terminal and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1700771A (en) * 2005-05-23 2005-11-23 上海广电(集团)有限公司中央研究院 Reinforced pixel domain code stream conversion method
CN101039421A (en) * 2006-03-16 2007-09-19 华为技术有限公司 Method and apparatus for realizing quantization in coding/decoding process
CN102164284A (en) * 2010-02-24 2011-08-24 富士通株式会社 Video decoding method and system
CN103826028A (en) * 2012-11-19 2014-05-28 腾讯科技(深圳)有限公司 Method and device for compressing picture in lossless way
CN103916678A (en) * 2012-12-31 2014-07-09 中国移动通信集团广东有限公司 Multimedia data transcoding method, transcoding device and multimedia data play system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1700771A (en) * 2005-05-23 2005-11-23 上海广电(集团)有限公司中央研究院 Reinforced pixel domain code stream conversion method
CN101039421A (en) * 2006-03-16 2007-09-19 华为技术有限公司 Method and apparatus for realizing quantization in coding/decoding process
CN102164284A (en) * 2010-02-24 2011-08-24 富士通株式会社 Video decoding method and system
CN103826028A (en) * 2012-11-19 2014-05-28 腾讯科技(深圳)有限公司 Method and device for compressing picture in lossless way
CN103916678A (en) * 2012-12-31 2014-07-09 中国移动通信集团广东有限公司 Multimedia data transcoding method, transcoding device and multimedia data play system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018196502A1 (en) * 2017-04-27 2018-11-01 腾讯科技(深圳)有限公司 Method and device for image transcoding
US10904542B2 (en) 2017-04-27 2021-01-26 Tencent Technology (Shenzhen) Company Limited Image transcoding method and apparatus
CN112887608A (en) * 2021-01-27 2021-06-01 维沃移动通信有限公司 Image processing method and device, image processing chip and electronic equipment
CN113486939A (en) * 2021-06-30 2021-10-08 平安证券股份有限公司 Method, device, terminal and storage medium for processing pictures
CN113486939B (en) * 2021-06-30 2024-07-09 平安证券股份有限公司 Picture processing method, device, terminal and storage medium

Also Published As

Publication number Publication date
CN106611432B (en) 2020-09-04

Similar Documents

Publication Publication Date Title
CN104199927B (en) Data processing method and data processing equipment
CN105338352B (en) Adaptive quantification method and device in a kind of Video coding
CN102246165B (en) Method and apparatus for representing and identifying feature descriptors utilizing a compressed histogram of gradients
CN104301724B (en) Method for processing video frequency, encoding device and decoding device
CN104683801B (en) Method for compressing image and device
CN103402091B (en) Cloud desktop picture classification nad code method
CN107211133A (en) Method, device and the decoding device of inverse quantization conversion coefficient
CN105144231A (en) Method and device for selecting an image dynamic range conversion operator
CN106507107B (en) The treating method and apparatus of data
CN106611432A (en) Picture format conversion method, device and system
WO2012014170A1 (en) Method and apparatus for providing complexity balanced entropy coding
US9153017B1 (en) System and method for optimized chroma subsampling
CN102917157A (en) Image compression system and method based on human visual system
CN104581158A (en) Quantization table and image compression processing methods and devices, terminal and image searching system
CN107027028B (en) Random offset based on JND quantifies multiple description coded, decoded method and system
CN105791849A (en) Image compression method and device
CN106961607B (en) Time-domain lapped transform based on JND is multiple description coded, decoded method and system
CN107172425B (en) Thumbnail generation method and device and terminal equipment
Li et al. Compressed image sensing by jointly leveraging multi-scale heterogeneous priors for the Internet of multimedia things
CN105007483B (en) A kind of screen content coding-decoding method compatible with H264 standards
CN103327337B (en) A kind of classification quantitative coding method based on biorthogonal lapped transform
Blasco et al. Transference of vector-valued multipliers on weighted Lp-spaces
CN102271252B (en) Image compression method having variable quantization parameters
Ma et al. Compressive Sensing Solution Optimization Method in Sensing-Transmission-Calculation Integrated System
Kumari et al. Improved structure similarity in fractal image compression with quad tree

Legal Events

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