A kind of MP3 water mark method for improving mp3 file watermark embedding capacity
Technical field
The present invention relates to a kind of MP3 watermarking method, particularly a kind of MP3 water mark method for improving mp3 file watermark embedding capacity, the method is based on little value district Huffman table code word and watermark mapping relations.
Background technology
The numerical information revolution has brought deep variation for human society and life, has also brought new challenge and innovation opportunity simultaneously.The digital multimedia works can perfect copy with world wide in need hardly the distribution of cost, make the safety problems such as digital copyright protecting and content integrity checking become problem in the urgent need to address.The AIFC of moving at Internet and various machine at present has a lot, and the main audio file formats of two classes is wherein arranged: lossless format with diminish form.Lossless format comprises: WAV, PCM, TTA, FLAC, AU, APE, TAK, WavPack (WV) etc.; Diminishing form comprises: MP3, and Windows Media Audio (WMA), Ogg Vorbis (OGG), AAC etc., the most general with the audio file of MP3 compressed format in numerous audio file formats, spread scope also is the widest.The MP3 full name is MPEG-1Audio Layer III, it is the 3rd layer concrete application in the MPEG-1 audio standard, it can make ratio of compression reach 1: 10 or 1: 12 (L.G.Zhang under the condition that keeps CD Quality, R.D.Wang, and D.Q.Yan.Data hiding in mp3 audio by modifying qmdct coefficients[A] .In Computing, Communication, Control, and Management, 2009.CCCM2009.ISECS International Colloquium on; C.T.Wang, T.S.Chen, and W.H.Chao.A new audio watermarking based on modified discrete cosine transform of mpeg/audio layer iii[A] .In Networking, Sensing and Control, 2004 IEEE International Conference on), greatly save storage space, thereby also become more and more record companies and the music making people selects it as the first-selected audio format that is published on the internet.Although proposed again afterwards the audio formats such as AAC (audio scheme that proposes among the Advanced Audio Coding:MPEG-2), WMA, Ogg, VQF, they all increase on ratio of compression and audio quality, all fail to shake the dominant position of MP3.Under the restriction of consumer's factor and computer technology factor, MP3 will be audio format the most popular on the internet within the quite a long time.Yet; the just popularity of MP3 and convenience; so that the piracy of MP3 musical works and illegal download all become very frequent, this causes the legitimate rights and interests of creator and affiliated company thereof to be subject to serious infringement, and the MP3 Copyright Protection on the internet becomes the focus that receives much concern day by day.And digital watermarking with some Information hiding in digital picture, video or sound signal, become a kind of effective means of protecting digital media content safety.
Digital watermarking algorithm for MP3 is divided into following a few class according to the difference on opportunity that embeds at present: 1) the robust audio watermark of the compressed and decompressed attack of anti-MP3, such watermarking algorithm mainly is to carry out behind the time-frequency conversion embed watermark on frequency domain for the sound signal of original PCM, even its effect is original audio attacked by the MP3 compression and decompression after, still can extract watermark and carry out the functions such as copyright authentication, method (J.Wang such as people such as Wang, R.Healy, and J.Timoney.A robust audio watermarking scheme based on reduced singular value decomposition and distortion removal[J] Signal Processing, 2011.).2) in conjunction with the MP3 watermark of cataloged procedure, this type of watermarking algorithm mainly is the compression encoding process in conjunction with MP3, come embed watermark by the MDCT coefficient before the modification quantification or the MDCT coefficient after the quantification, or utilize other characteristics in the MP3 cataloged procedure to come embed watermark, its effect is that the MP3 watermarking algorithm has certain robustness, owing to self just combining the MP3 cataloged procedure, so compression and decompression have robustness to MP3, method (Akinori Ito etc. " Data Hiding is a Better Way for Transmitting Side Information for MP3 Bitstream " such as Akinori, 5th International Conference on Intelligent Information Hiding and Multimedia Signal Processing, 2009.).3) in conjunction with the MP3 watermark of decode procedure, this type of watermarking algorithm mainly is that mp3 file is carried out partial decoding of h, then come embed watermark by the partial data of revising in the MP3 code stream, the data of revising are generally large value district data, scale factor and little value district data etc., be characterized in that real-time is good, such as method (Rangding Wang, the etc. " A Novel data hiding algorithm for MP3 audio " of Wang, ICSP, 2008.)
Because MP3 mainly propagates at Internet, its popularity and velocity of propagation have determined that the MP3 watermark needs requirement of real time, therefore more can satisfy the requirement of real-time than the algorithm of other types in conjunction with the watermarking algorithm of MP3 decoding process.The people such as Yan have proposed a kind of improvement algorithm (Y.Diqun for the hidden writing tools of MP3Stego in 2009, W.Rangding, and Z.Liguang.Quantization step parity-based steganography for mp3 audio[J] .Fundamenta Informaticae, 2009,97 (1): 1-14), eliminated potential endless loop in the MP3Stego algorithm; Yan and Wang proposed in 2011 a kind of large value district Huffman table replace the MP3 watermark selected (D.Yan and R.Wang.Huffman table swapping-based steganograpy for mp3 audio[J] .Multimedia Tools and Applications, 2011, pages 1-15.), its algorithm on capacity more in the past the MP3 watermarking algorithm improve a lot, and guaranteed audio quality.The algorithm of Yan and Wang all is the watermarking algorithm in conjunction with the MP3 cataloged procedure, although its audio quality or capacity have good effect, real-time remains further to be improved, the space that also is improved on embedding capacity simultaneously.
Summary of the invention
The technical problem to be solved in the present invention is: overcome the deficiencies in the prior art, a kind of MP3 water mark method for improving mp3 file watermark embedding capacity is provided, the method is by the characteristic of code word in the little value of the research district Huffman table, use the method for code word classification to set up the mapping relations of code word and watermark, and utilize this pass to tie up to embed watermark in the mp3 file.This method can embed a large amount of watermarks in the situation that introduce less distortion, and its watermark embedding capacity method more in the past improves a lot.
The technical solution adopted for the present invention to solve the technical problems: a kind of MP3 water mark method for improving mp3 file watermark embedding capacity, the method comprises code word classification, code word and watermark mapping, watermark embed process and watermark extraction process; Described code word classification is that all code words in the little value district Huffman table are divided according to the Hamming weight difference; Described code word and watermark mapping is to set up mapping relations between code word and the watermark according to code word classification results and Hamming distance minimum principle; Described watermark embed process is: before watermark embeds, code word in the little value district Huffman that uses in the MP3 cataloged procedure table is classified according to code word Hamming weight difference, then set up mapping relations between code word and watermark according to classification results and Hamming distance minimum principle; In telescopiny, successively the every frame data in the mp3 file are decoded, when being decoded to little value district, whenever decode a little value district quaternary class value, just according to the mapping relations embed watermark between code word and watermark, then amended code word is write mp3 file; At last, the MP3 frame that all is disposed reconstitutes the mp3 file that contains watermark; Described watermark extraction process is: equally the every frame data in the mp3 file are decoded, when being decoded to little value district data, whenever decoding a little value district quaternary class value and just extract watermark according to the mapping relations between code word and watermark;
Described watermark embed process is specific as follows:
A. read in mp3 file, it is carried out the MP3 decoding operation.Decode procedure carries out according to the decoding process in the MP3 standard, and each frame data in the mp3 file after the large value district data of having decoded, are carried out the decode operation in little value district;
When b. being decoded to little value district data, whenever decoding a little value district four-tuple, find out target code word behind the embed watermark according to the little value district Huffman shown in the table 1 table code word and watermark mapping relations, this target code word will be replaced the corresponding original code word of four-tuple.If the corresponding code word of the four-tuple that decodes is the untapped code word in the table 1, then keep its code word constant;
C. after the little value district data in this frame being disposed according to step b, jointly reconstituting new frame data with other data of large value district's data and present frame, and jump to the processing that step b carries out next frame;
D. after all frames in the mp3 file all pass through the processing of watermark embedding operation, new MP3 frame is reconstituted the mp3 file that contains watermark.
Described watermark extraction process is specific as follows:
A1. read in mp3 file, it is carried out the MP3 decoding operation.Carry out according to the decoding process in the MP3 standard in the decode procedure, each frame data in the mp3 file after the large value district data of having decoded, are carried out the decode operation in little value district;
When b1. being decoded to little value district data, whenever decoding a little value district four-tuple, find out the corresponding watermark of code word of this four-tuple according to the table code word of the little value district Huffman shown in the table 1 and watermark mapping relations, be the watermark that extracts.If the corresponding code word of the four-tuple that decodes is the untapped code word in the table 1, then do not extract watermark;
C1. after all frames in the mp3 file all pass through the watermark extracting operational processes, all watermark informations that extract are merged into watermark file.
Further, described code word classification, the object of its classification is 2 the Huffman tables for the little value district data of encoding in the MP3 coding standard, criteria for classification is: the Hamming weight that calculates each four-tuple in each Huffman table, the corresponding code word of the four-tuple that Hamming weight is identical is classified as same class, if code word number is less than 4 in certain class, then all code words in such are included in other these classes.Classification results is as shown in table 2.
Further, the method for building up of little value district Huffman table code word and watermark mapping relations is as follows:
Simplify for the code word classification results in the little value district Huffman table, so that the code word number in every class is 2
n(n 〉=2).Namely on the classification results of table 2, the code word in every class is chosen suitable 2
nThen individual code word sets up the mapping relations of these code words and watermark.Code word need to satisfy when choosing in each classification: selected 2
nIndividual code word, its Hamming distance each other must be minimum, and is minimum to guarantee the modification to original audio behind the embed watermark.The mapping relations of code word and watermark are as shown in table 1 in the final little value district Huffman table of setting up.
Further, in the described watermark embed process, according to code word and watermark mapping relations embed watermark in the little value district Huffman table, its concrete meaning is as follows:
4 four-tuple of Hamming weight as 1 describe as example in the little value district Huffman Table A of table 1, and all classes among the table B of all classes of other in the Table A of table 1 and table 1 all can be by that analogy.Concrete steps are:
If a2. 2 bit watermark to be embedded are 00, no matter then what the corresponding code word of the current four-tuple that decodes is, it is revised as four-tuple 0001 corresponding code word 0101;
If b2. 2 bit watermark to be embedded are 01, no matter then what the corresponding code word of the current four-tuple that decodes is, it is revised as four-tuple 0010 corresponding code word 0100;
If c2. 2 bit watermark to be embedded are 10, no matter then what the corresponding code word of the current four-tuple that decodes is, it is revised as four-tuple 0100 corresponding code word 0110;
If d2. 2 bit watermark to be embedded are 11, no matter then what the corresponding code word of the current four-tuple that decodes is, it is revised as four-tuple 1000 corresponding code words 0111;
If the four-tuple that e2. decodes is among the Table A of table 1 and the table B during untapped code word, keep the corresponding code word of this four-tuple constant, do not carry out any operation.
Further, in the described watermark extraction process, extract watermark according to code word and watermark mapping relations in the little value district Huffman table, its concrete meaning is as follows:
4 four-tuple of Hamming weight as 1 describe as example in the little value district Huffman Table A of table 1, and all classes among all classes of other in the Table A and the table B all can be by that analogy.Concrete steps are:
If the four-tuple that a3. decodes is 0001, then extract 2 bit watermark 00;
If the four-tuple that b3. decodes is 0010, then extract 2 bit watermark 01;
If the four-tuple that c3. decodes is 0100, then extract 2 bit watermark 10;
If the four-tuple that d3. decodes is 1000, then extract 2 bit watermark 11;
If the four-tuple that e3. decodes is among the Table A of table 1 and the table B during untapped code word, there is not the watermark can be for extracting.
Further, set up in the process of code word and watermark mapping relations in the little value district Huffman table, choose 2 of Hamming distance minimum in every class
nDuring individual code word, when run into other 2
nWhen the combination of individual code word has the characteristic of Hamming distance minimum equally, the combination in the table 2 can be chosen, also the code word combination that other satisfy this characteristic can be chosen.
The advantage that the present invention compared with prior art has is:
(1) a kind of MP3 water mark method for improving mp3 file watermark embedding capacity of the present invention, employed difference according to Hamming weight is carried out the method for little value district Huffman table code word classification, more can embody the information characteristic of code word in the little value district Huffman table, to after the mapping relations of MP3 watermark set up and watermarking algorithm has good booster action.
(2) a kind of MP3 water mark method for improving mp3 file watermark embedding capacity of the present invention, the little value district Huffman table code word of setting up and the mapping relations of watermark, comprise 4 code words in every class, corresponding 2 bit watermark, thereby, have greatly improved according to the capacity of this mapping relations embed watermark.
(3) a kind of MP3 water mark method for improving mp3 file watermark embedding capacity of the present invention, it is at little value district embed watermark, more traditional MP3 watermarking algorithm is less to the quality influence of MP3 audio frequency at large value district embed watermark, thereby the audio quality behind the embed watermark is better.
(4) a kind of MP3 water mark method for improving mp3 file watermark embedding capacity of the present invention, employed watermark embedding method in conjunction with the MP3 decoding process, the watermarking algorithm that carries out again the MP3 compression in conjunction with embed watermark in the watermark of MP3 compression encoding process and the original audio watermark, its real-time better effects if.
Description of drawings
Fig. 1 is watermark embedding of the present invention and watermark extracting process flow diagram.
Embodiment
The present invention is further described in detail below in conjunction with the drawings and specific embodiments.
The general frame figure of a kind of MP3 water mark method for improving mp3 file watermark embedding capacity of the present invention as shown in Figure 1.Overall flow mainly comprises watermark embedding and watermark extracting two large divisions.The method specifically comprises code word classification, code word and watermark mapping, watermark embed process and watermark extraction process; The code word classification is that all code words in the little value district Huffman table are divided according to the Hamming weight difference; Code word and watermark mapping is to set up mapping relations between code word and the watermark according to code word classification results and Hamming distance minimum principle; Watermark embed process is: before watermark embeds, code word in the little value district Huffman that uses in the MP3 cataloged procedure table is classified according to code word Hamming weight difference, then set up mapping relations between code word and watermark according to classification results and Hamming distance minimum principle; In telescopiny, successively the every frame data in the mp3 file are decoded, when being decoded to little value district, whenever decode a little value district quaternary class value, just according to the mapping relations embed watermark between code word and watermark, then amended code word is write mp3 file; At last, the MP3 frame that all is disposed reconstitutes the mp3 file that contains watermark; Watermark extraction process is: equally the every frame data in the mp3 file are decoded, when being decoded to little value district data, whenever decoding a little value district quaternary class value and just extract watermark according to the mapping relations between code word and watermark.
Wherein, the code word classification is that all code words in the little value district Huffman table are divided according to Hamming weight is different with Hamming distance, criteria for classification is: the Hamming weight that calculates each four-tuple in each Huffman table, the corresponding code word of the four-tuple that Hamming weight is identical is classified as same class, if code word number is less than 4 in certain class, then all code words in such are included into not in the use classes.Classification results is as shown in table 2.
Code word classification in little value district Huffman among the present invention table and code word and watermark mapping relations to set up process as follows:
Wherein, set up the mapping relations of little value district Huffman table code word and watermark, at first need the code word classification results in the little value district Huffman table is simplified, so that the code word number in every class is 2
n(n 〉=2).Namely on the classification results of table 2, the code word in every class is chosen suitable 2
nThen individual code word sets up the mapping relations of these code words and watermark.Code word need to satisfy when choosing in each classification: selected 2
nIndividual code word, its Hamming distance each other must be minimum, and is minimum to the modification of original audio to guarantee behind the embed watermark.The mapping relations of code word and watermark are as shown in table 1 in the final little value district Huffman table of setting up.In addition, choose 2 of Hamming distance minimum in every class
nDuring individual code word, when run into other 2
nWhen the combination of individual code word has the characteristic of Hamming distance minimum equally, the combination in the table 2 can be chosen, also the code word combination that other satisfy this characteristic can be chosen.
The concrete steps of the watermark embed process among the present invention are as follows:
A. read in mp3 file, it is carried out the MP3 decoding operation.Carry out according to the decoding process in the MP3 standard in the decode procedure, each frame data in the mp3 file after the large value district data of having decoded, are carried out the decode operation in little value district;
When b. being decoded to little value district data, whenever decoding a little value district four-tuple, find out target code word behind the embed watermark according to the little value district Huffman shown in the table 1 table code word and watermark mapping relations, this target code word will be replaced the corresponding original code word of four-tuple.If the corresponding code word of the four-tuple that decodes is the untapped code word in the table 1, then keep its code word constant; Wherein, according to code word and watermark mapping relations embed watermark in the little value district Huffman table, its concrete meaning is as follows:
4 four-tuple of Hamming weight as 1 describe as example in the little value district Huffman Table A of table 1, and all classes among other classes in the Table A of table 1 and the table B of table 1 all can be by that analogy.Concrete steps are:
If a2. 2 bit watermark to be embedded are 00, no matter then what the corresponding code word of the current four-tuple that decodes is, it is revised as four-tuple 0001 corresponding code word 0101;
If b2. 2 bit watermark to be embedded are 01, no matter then what the corresponding code word of the current four-tuple that decodes is, it is revised as four-tuple 0010 corresponding code word 0100;
If c2. 2 bit watermark to be embedded are 10, no matter then what the corresponding code word of the current four-tuple that decodes is, it is revised as four-tuple 0100 corresponding code word 0110;
If d2. 2 bit watermark to be embedded are 11, no matter then what the corresponding code word of the current four-tuple that decodes is, it is revised as four-tuple 1000 corresponding code words 0111;
If the four-tuple that e2. decodes is among the Table A of table 1 and the table B during untapped code word, keep the corresponding code word of this four-tuple constant, do not carry out any operation.
C. after the little value district data in this frame being disposed according to step b, jointly reconstituting new frame data with other data of large value district's data and present frame, and jump to the processing that step b carries out next frame;
D. after all frames in the mp3 file all pass through the processing of watermark embedding operation, new MP3 frame is reconstituted the mp3 file that contains watermark.
The concrete steps of the watermark extraction process among the present invention are as follows:
A1. read in mp3 file, it is carried out the MP3 decoding operation.Carry out according to the decoding process in the MP3 standard in the decode procedure, each frame data in the mp3 file after large value district data are played in decoding, are carried out the decode operation in little value district;
When b1. being decoded to little value district data, whenever decoding a little value district four-tuple, find out the corresponding watermark of code word of this four-tuple according to the table code word of the little value district Huffman shown in the table 1 and watermark mapping relations, be the watermark that extracts.If the corresponding code word of the four-tuple that decodes is the untapped code word in the subordinate list 1, then do not extract watermark; Wherein, extract watermark according to code word and watermark mapping relations in the little value district Huffman table, its concrete meaning is as follows:
4 four-tuple of Hamming weight as 1 describe as example in the little value district Huffman Table A of table 1, and all classes among other classes in the Table A of table 1 and the table B of table 1 all can be by that analogy.Concrete steps are:
If the four-tuple that a3. decodes is 0001, then extract 2 bit watermark 00;
If the four-tuple that b3. decodes is 0010, then extract 2 bit watermark 01;
If the four-tuple that c3. decodes is 0100, then extract 2 bit watermark 10;
If the four-tuple that d3. decodes is 1000, then extract 2 bit watermark 11;
If the four-tuple that e3. decodes is among the Table A of table 1 and the table B during untapped code word, there is not the watermark can be for extracting.
C1. after all frames in the mp3 file all pass through the processing of watermark embedding operation, all watermark informations that extract are merged into watermark file.
In table 3, the algorithm that is used for two pieces of papers relatively and is the at present newer paper about the MP3 watermark: Yan2009 representative is that the people such as Yan has proposed a kind of improvement algorithm for the hidden writing tools of MP3Stego (Y.Diqun in 2009, W.Rangding, and Z.Liguang.Quantization step parity-based steganography for mp3 audio[J] Fundamenta Informaticae, 2009,97 (1): 1-14), eliminated potential endless loop in the MP3Stego algorithm; The algorithm of Yan2011 representative be Yan and Wang proposed in 2011 a kind of large value district Huffman table replace the MP3 watermark selected (D.Yan and R.Wang.Huffman table swapping-based steganograpy for mp3 audio[J] Multimedia Tools and Applications, 2011, pages 1-15.), its algorithm on capacity more in the past the MP3 watermarking algorithm improve a lot.Test employed testing audio and comprised the audio frequency of different-style in 5, be respectively: classical, blues, country, folk and pop.
Experimental result from table 3 can find out, the MP3 watermark based on code word in the little value district Huffman table and watermark mapping relations in this paper has very large raising than the algorithm of the people such as Yan proposition on embedding capacity.
Wherein, table 1 is code word and watermark mapping relations table in the little value district Huffman table of setting up among the present invention;
The code word classification results of table 2 among the present invention little value district Huffman being shown;
The experimental result signal table that table 3 is relatively gone up at maximum embedding capacity for the algorithm of the algorithm among the present invention and Yan and Wang.
Table 1
Table 2
Table 3
The part that the present invention does not elaborate belongs to techniques well known.