CN103581673A - Video data compression or decompression method and system - Google Patents

Video data compression or decompression method and system Download PDF

Info

Publication number
CN103581673A
CN103581673A CN201210277852.6A CN201210277852A CN103581673A CN 103581673 A CN103581673 A CN 103581673A CN 201210277852 A CN201210277852 A CN 201210277852A CN 103581673 A CN103581673 A CN 103581673A
Authority
CN
China
Prior art keywords
data
data block
quantization parameter
budget
compression
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.)
Pending
Application number
CN201210277852.6A
Other languages
Chinese (zh)
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.)
SHANGHAI SUANXIN MICROELECTRONICS CO Ltd
Original Assignee
SHANGHAI SUANXIN MICROELECTRONICS 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 SHANGHAI SUANXIN MICROELECTRONICS CO Ltd filed Critical SHANGHAI SUANXIN MICROELECTRONICS CO Ltd
Priority to CN201210277852.6A priority Critical patent/CN103581673A/en
Publication of CN103581673A publication Critical patent/CN103581673A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention relates to a video data compression or decompression method and system. The compression method includes the steps that firstly, video data are divided into a plurality of basic units of a unified specification, wherein each basic unit comprises at least one data block; secondly, the basic units are read; thirdly, all the data blocks in the read basic units are compressed and coded in parallel according to respective designated compression preliminary calculation, and compressed data of all the data blocks are acquired, wherein the length of the compressed data of each data block is consistent with the designated compression preliminary calculation of the data block; fourthly, the position of the compressed data of each data block in an output buffer is determined according to the compression preliminary calculation of each data block, and therefore the compressed data of all the data blocks in the read basic units can be distributed in the output buffer in parallel; fifthly, the compressed data of all the data blocks are serially output by the output buffer, and then the compressed data of the read basic units are acquired.

Description

The compressing/decompressing method of video data and system
Technical field
The present invention relates to a kind of compressing/decompressing method and system, particularly for compressing/decompressing method and the system of video data.
Background technology
The emphasis of existing video data compression method design is mainly in the efficiency of data compression, be mainly used in storage and the transmission field of video data, object is to reduce the needed space of Video Data Storage and video data needed bandwidth in network transmission process.
Yet in multimedia ASIC design, the read-write stage that the main bandwidth demand of ASIC inside and bandwidth bottleneck concentrate on video data, writing out of the reconstruction video view data that for example video decode obtains, demonstration of the reconstructed image data that video decode obtains etc. all can take bandwidth resources in a large amount of sheets.If the video data to output first carries out compressed encoding and writes out, when reading video data, first decode to process shows again, by the bandwidth that effectively reduces data and transmit between each module of ASIC inside.
Traditional compression method of take the video data that compression efficiency is design object, nature can cause having very strong data dependence between the context of data after compression, be difficult to realize being accurate to macro block rank, the even arbitrary access of the video data of the small scale such as piece rank, be therefore difficult to be applied to above-mentioned occasion.
Traditional compression method of take the video data that compression efficiency is design object, because packed data between each piece is interrelated, the size that generates code stream is also different, and the complete parallel compression and the seamless code stream that are difficult to realize between each coding unit piece assemble.
Summary of the invention
The present invention proposes a kind of compressing/decompressing method and system of video data, the method and system can be optimized the bandwidth of multimedia ASIC reading and writing data link, and can realize the compression of complete parallel between the random read-write of each packed data unit and packed data unit is processed and the assembling of seamless code stream.
According to an aspect of the present invention, proposed a kind of compression method of video data, the method comprises:
1) video data is divided into a plurality of elementary cells with unified specification, described in each, elementary cell comprises at least one data block;
2) read described elementary cell,
3) each data block in the described elementary cell reading is carried out to compressed encoding concurrently according to specified compression budget separately, obtain the packed data of described each data block, wherein the compression budget of the length of the packed data of each data block and the appointment of this data block is consistent
4) position of the packed data of determining each data block according to the compression budget of each data block in output buffer, thus the packed data of each data block in the elementary cell reading is assigned in output buffer concurrently;
5) packed data of described each data block of described output buffer serial output, thereby the packed data of the elementary cell that acquisition is read; And
Wherein, in step 3), for the compressed encoding of each data block, comprise:
3.1) data block is carried out to discrete cosine transform and obtain coefficient matrix, and the coefficient in coefficient matrix is quantized to obtain a plurality of quantization parameters; And
3.2) described a plurality of quantization parameters are encoded one by one, and monitor the use state of the compression budget of this data block, when the coding result of completed quantization parameter reaches the compression budget of this data block, stop the coding of current quantization parameter, and abandon the quantization parameter of encoding, using the coding result of completed quantization parameter as the packed data of data block.
Preferably, in step 3.1) in, described coefficient matrix is carried out to layering, and take different quantization resolutions to quantize to obtain quantization parameter to the coefficient in each layer.
Preferably, step 3.2) comprising:
A) judge whether remaining compression budget is 0, if remaining compression budget is 0, stops immediately the coding to current quantization parameter, and export the coding result of the quantization parameter having completed as the packed data of data block; If remaining compression budget is not 0, enter step b);
B) judge whether remaining compression budget is more than or equal to the length of the coding result of current quantization parameter, if remaining compression budget is more than or equal to the length of the coding result of current quantization parameter, complete the coding of current quantization parameter, record remaining compression budget, and return to step a); Otherwise enter step c);
C) with the length of residual compression budget, block the coding result of current quantization parameter, and export the coding result of all quantization parameters that complete as the packed data of data block.
Preferably, adopt the method for entropy coding to encode to quantization parameter, and sign bit is arranged in to list item front end.
Preferably, with the compression factor of fixing, elementary cell is compressed, obtained having the packed data of the elementary cell of unified size.
According to a further aspect in the invention, proposed a kind of compressibility of video data, this system comprises:
Memory, storage is divided into a plurality of video datas with the elementary cell of unified specification, and described in each, elementary cell comprises at least one data block;
Input register, reads and preserves each data block in described elementary cell;
Compression set, comprise at least one encoder, by described at least one encoder, each data block in the described elementary cell reading is carried out to compressed encoding concurrently according to specified compression budget separately, the packed data that obtains described each data block, wherein the compression budget of the length of the packed data of each data block and the appointment of this data block is consistent;
Budget allocation controller, for each the encoder specified compression budget in compression set, and the position of the packed data of determining each data block according to this compression budget in output buffer, thereby the packed data of each data block in the elementary cell reading is assigned in output buffer concurrently;
Output buffer, the packed data of described each data block of serial output, thereby the packed data of the elementary cell that acquisition is read; And
Wherein, described in each, encoder carries out discrete cosine transform to data block and obtains coefficient matrix, and the coefficient in coefficient matrix is quantized to obtain a plurality of quantization parameters; And described a plurality of quantization parameters of each data block are encoded one by one, monitor the use state of the compression budget of this data block simultaneously, when the coding result of completed quantization parameter reaches compression budget, stop the coding of current quantization parameter, and abandon the quantization parameter of encoding, using the coding result of the quantization parameter that completed as the packed data of data block.
Preferably, described encoder carries out layering to described coefficient matrix, and takes different quantization resolutions to quantize to obtain quantization parameter to the coefficient in each layer.
Preferably, described encoder is carried out following operation:
A) judge whether remaining compression budget is 0, if remaining compression budget is 0, stops immediately the coding to current quantization parameter, and export the coding result of the quantization parameter having completed as the packed data of data block; If remaining compression budget is not 0, enter step b);
B) judge whether remaining compression budget is more than or equal to the length of the coding result of current quantization parameter, if remaining compression budget is more than or equal to the length of the coding result of current quantization parameter, complete the coding of current quantization parameter, record remaining compression budget, and return to step a); Otherwise enter step c);
C) with the length of residual compression budget, block the coding result of current quantization parameter, and export the coding result of all quantization parameters that complete as the packed data of data block.
Preferably, adopt the method for entropy coding to encode to quantization parameter, and sign bit is arranged in to list item front end.
Preferably, with the compression factor of fixing, elementary cell is compressed, obtained having the packed data of the elementary cell of unified size.
According to a further aspect in the invention, proposed a kind of decompression method of video data, the method comprises:
1) from memory, read the packed data of elementary cell, the packed data of described elementary cell is compressed and obtains elementary cell by above-mentioned compression method;
2) position of the packed data of determining each data block according to the corresponding compression budget of the packed data of each data block in the packed data of described elementary cell in input buffer, thus the packed data of each data block is assigned to each decoder from input buffer concurrently;
3) by each decoder, the packed data of each data block is decompressed concurrently, obtain the decompressed data of described each data block;
4) decompressed data of described each data block of output, thus the elementary cell after decompressing obtained;
Wherein, in step 3), the decompression to each data block comprises:
3.1) coding result of the quantization parameter in the packed data of data block is decoded one by one, and monitor the use state of the compression budget of this data block, when complete corresponding to the packed data of the data block of predetermined compression budget decoding time, stop the decoding to this data block;
3.2) to completing the quantization parameter of decoding, carry out inverse quantization and obtain coefficient matrix, and carry out the decompressed data that inverse discrete cosine transform obtains data block.
Preferably, step 3.1) comprising:
A) judge that whether remaining compression budget is 0, if remaining compression budget is 0, stops the decoding to the quantization parameter of this data block immediately; If remaining compression budget is not 0, enter step b);
B) judge whether remaining compression budget is more than or equal to the coding result length of the current quantization parameter that will decode, if whether remaining compression budget is more than or equal to the coding result length of the current quantization parameter that will decode, the current quantization parameter that will decode is decoded, record remaining compression budget, and return to step a), otherwise enter step c);
Whether the coding result that c) judges remaining compression Budget correspondence comprises sign bit, if comprise sign bit, the bit this coding result being dropped in cataloged procedure is decoded after with 0 polishing, obtain the decoded result of last quantization parameter, if do not comprise sign bit, the decoded result of this last quantization parameter is made as to 0.
According to a further aspect in the invention, proposed a kind of decompression systems of video data, this system comprises:
Memory, the packed data of storage elementary cell, the packed data of described elementary cell is by the system described in any one in claim 5 to 8, elementary cell to be compressed and obtained;
Input buffer, reads and cushions the packed data of described elementary cell;
Budget allocation controller, the position of the packed data of determining each data block according to the corresponding compression budget of the packed data of each data block in the packed data of described elementary cell in input buffer, thus the packed data of each data block is assigned to each decoder from input buffer concurrently;
Decompressing device, comprises at least one decoder, by each decoder, the packed data of each data block is decompressed concurrently, obtains the decompressed data of described each data block and offers output register;
Output register, receives and exports the decompressed data of described each data block, thereby obtains the elementary cell after decompressing;
Wherein, described in each, decoder is decoded one by one to the coding result of the quantization parameter in the packed data of data block, and monitor the use state of the compression budget of this data block, when complete corresponding to the packed data of the data block of predetermined compression budget decoding time, stop the decoding to this data block, to completing the quantization parameter of decoding, carry out inverse quantization and obtain coefficient matrix, and carry out the decompressed data that inverse discrete cosine transform obtains data block.
Preferably, described encoder is carried out following operation:
A) judge that whether remaining compression budget is 0, if remaining compression budget is 0, stops the decoding to the quantization parameter of this data block immediately; If remaining compression budget is not 0, enter step b);
B) judge whether remaining compression budget is more than or equal to the coding result length of the current quantization parameter that will decode, if whether remaining compression budget is more than or equal to the coding result length of the current quantization parameter that will decode, the current quantization parameter that will decode is decoded, record remaining compression budget, and return to step a), otherwise enter step c);
Whether the coding result that c) judges remaining compression Budget correspondence comprises sign bit, if comprise sign bit, the bit this coding result being dropped in cataloged procedure is decoded after with 0 polishing, obtain the decoded result of last quantization parameter, if do not comprise sign bit (step S503: no), the decoded result of this last quantization parameter be made as to 0.
Method and system of the present invention has been realized video data compression and decompression that can random access.This scheme can effectively reduce the transmission bandwidth of video data in multimedia ASIC design, has improved performance, can save the memory headroom of preserving such data simultaneously.
Due to separate the carrying out of encoding and decoding of each data block, and there is in advance known compression budget allocation information.The efficient implementation of being convenient to parallel encoding and decoding and code stream assembling, the performance of encoder can be significantly improved.
Accompanying drawing explanation
Fig. 1 has shown according to the flow chart of the compression method of video data of the present invention embodiment;
Fig. 2 has shown according to the schematic diagram of the layered quantization of coefficient matrix in the compression method of video data of the present invention;
Fig. 3 has shown according to the flow process of in the compression method of video data of the present invention, the quantization parameter of each data block is encoded embodiment;
Fig. 4 has shown according to the structure chart of the compression set of video data of the present invention embodiment;
Fig. 5 has shown according to the flow chart of the decompression method of video data of the present invention embodiment;
Fig. 6 has shown according to the flow chart of in the decompression method of video data of the present invention, the quantization parameter of each data block is decoded embodiment;
Fig. 7 has shown according to the structure chart of the decompressing device of video data of the present invention embodiment.
Embodiment
Principle of the present invention is, video data is divided into the elementary cell (TILE) with unified size, using this elementary cell as compression or the basic object of decompression, each elementary cell is compressed or decompression operation independently, make do not possess correlation between the compression of each elementary cell or decompression result, thereby realize the random access to each elementary cell.Each elementary cell with unified size can be comprised of a plurality of data blocks, in the process of each elementary cell being compressed or being decompressed, concurrently each data block is compressed or decompressed, and set and compress budget for each data block, thereby the complete parallel of all data blocks that realization comprises each elementary cell is processed and the assembling of seamless code stream.
Fig. 1 has shown that in this embodiment, the method comprises according to the flow chart of the compression method of video data of the present invention embodiment:
S101, is divided into a plurality of elementary cells with unified specification by video data, and described in each, elementary cell comprises at least one data block;
S102, reads described elementary cell,
S103, each data block in the described elementary cell reading is carried out to compressed encoding concurrently according to specified compression budget separately, the packed data that obtains described each data block, wherein the compression budget of the length of the packed data of each data block and the appointment of this data block is consistent
S104, the position of the packed data of determining each data block according to the compression budget of each data block in output buffer, thus the packed data of each data block in the elementary cell reading is assigned in output buffer concurrently;
S105, the packed data of described each data block of described output buffer serial output, thereby the packed data of the elementary cell that acquisition is read; And
Wherein, in step S103, the compressed encoding for each data block comprises:
S1031, carries out discrete cosine transform to data block and obtains coefficient matrix, and the coefficient in coefficient matrix is quantized to obtain a plurality of quantization parameters; And
S1032, described a plurality of quantization parameters are encoded one by one, and monitor the use state of the compression budget of this data block, when the coding result of completed quantization parameter reaches the compression budget of this data block, stop the coding of current quantization parameter, and abandon the quantization parameter of encoding, using the coding result of completed quantization parameter as the packed data of data block.
The summation of the compression budget of each data block in described elementary cell equals the length of the packed data of elementary cell, preferably, the summation of this compression budget is fixed value with the ratio (being the compression ratio of elementary cell) of the data length of elementary cell, the length of the packed data of the elementary cell obtaining is fixed and is equated, thereby realizes simple addressing and the arbitrary access of the packed data of elementary cell.
In this embodiment, because each elementary cell has unified specification, and the compression of each elementary cell is independent of to other elementary cells, therefore can realizes the arbitrary access to any elementary cell.
Preferably, the data block in described elementary cell has certain putting in order, and this putting in order can be depending on the adopted application backgrounds such as video encoding and decoding standard.In step S105, can export serially the packed data of each data block according to described putting in order, thereby obtain the packed data of described elementary cell.
Preferably, can need to select the unified specification of described elementary cell according to practical application, unified size for example, unified data structure etc.And can according to practical application need to select at least one data block that each elementary cell comprises quantity, size, put in order and data content etc.For instance, for meeting the H.264 video data of standard, it is 4 * 4 data matrixes that its conventional video data is processed minimum unit, therefore can 4 * 4 data matrixes as data block, can 8 * 8 data matrixes for meeting the video data of Joint Photographic Experts Group as data block.Each elementary cell can be comprised of the data block of any amount, and the data block in each elementary cell can have identical size or different sizes.
The encoder that passes through in step S103 carries out respectively in the process of parallelly compressed coding to each data block, for each data block has been allocated compression budget in advance, that is to say, each data block is preassigned through the length (or being called compression budget) of the packed data of gained after corresponding encoder encodes, preferably, the compression budget of each data block can be the same or different.The advantage of this embodiment is that, because the compression budget of each data block is specified in advance, the length of the packed data of each data block is predictable.Owing to having known in advance the length of the packed data of each data block, also starting point and the terminal of the packed data of just having known in advance each data block in output buffer, that is to say, the position of the packed data of each data block in output buffer can be predicted, therefore can be automatically, seamlessly, concurrently the packed data of all data blocks is assigned to the relevant position in output buffer, and exported by output buffer serial.This embodiment can realize the seamless assembling of packed data, greatly improves the operating efficiency of this compression method.
Preferably, in step S1031, can to coefficient matrix, carry out layering according to certain principle, and take different quantization resolutions to quantize to obtain quantization parameter to the coefficient in each layer.It is example that Fig. 2 be take 4 * 4 coefficient matrix, has described the schematic diagram that coefficient matrix is carried out to layering.The embodiment of Fig. 2 carries out layering according to the importance of coefficient, wherein with different gray scales, represented to have in coefficient matrix the coefficient of different importance, usingd coefficient 0 as ground floor, coefficient 1-5 is as the second layer, coefficient 6-9 is as the 3rd layer, and coefficient 10-15 is as the 4th layer.Principle from discrete cosine transform (DCT), in 4 * 4 the coefficient matrix arriving the data block of 4 * 4 after dct transform, the amount of information of coefficient 0 is maximum, and its importance is also the highest, and the importance away from the locational coefficient of coefficient 0 in coefficient matrix is lower.Therefore, from four layers of ground floors to the, the importance of coefficient reduces gradually, therefore can be ground floor and specify higher quantization resolution, carry out the quantification of " carefully ", and from the second layer to layer 5, reduce gradually quantization resolution, carry out the quantification of " slightly ", obtain 16 quantization parameters, thereby reaching under the condition of predetermined compression budget, realize best compression effectiveness.Although 4 * 4 the coefficient matrix of take in figure is example, in fact the size of data block and coefficient matrix is not limited to 4 * 4, also can select as required 8 * 8 or other sizes, the layered mode of coefficient matrix is also not limited to the ad hoc fashion shown in Fig. 2, and can be any other modes, as long as it can be realized coefficient matrix is carried out to layered quantization, to improve as far as possible the object of compression effectiveness.
In step S1032, quantization parameter is encoded one by one, and the use state of budget is compressed in monitoring in the process of coding, and according to this state, judge whether to carry out the coding of current quantization parameter.The compression budget that the coding result that can obtain by record takies, or record can with the variety of ways such as remaining compression budget monitor compression budget use state, as long as can make the compression budget that the coding result of each data block is equaled to be scheduled to by monitoring.
Fig. 3 has described a preferred implementation of this process, this embodiment has adopted the mode of monitoring remaining compression budget, the length of the predetermined compression budget of current data block and the current completed coding result of this data block (the compression budget of having used up) poor, is remaining compression budget.In the embodiments of figure 3, before each current quantization parameter to be encoded is encoded, first judge whether remaining compression budget is 0(step S301), if remaining compression budget is 0(step S301: be), stop immediately the coding to current quantization parameter, and export the coding result of the quantization parameter having completed as the packed data (S302) of data block; If remaining compression budget is not 0(step S301: no), judge whether remaining compression budget is more than or equal to the length of the coding result of current quantization parameter (step S303), the length of this coding result can obtain by the corresponding list item of searching in coding schedule; If remaining compression budget is more than or equal to the length (step S303: be) of the coding result of current quantization parameter, complete the coding of current quantization parameter, record remaining compression budget, and return to step S301(S304); Otherwise (step S303: no), blocks the coding result of current quantization parameter with the length of residual compression budget, and export the coding result of all quantization parameters that complete as the packed data (step S305) of data block.
Because having adopted the method for the coding result of " blocking " last quantization parameter, the embodiment shown in Fig. 3 guarantees the compression budget of being scheduled to, that is to say, when the coding result of judging last quantization parameter can cause the total length of packed data to exceed compression budget, only retain (for example high-order) that in the coding result of last quantization parameter, come above and compress budget bit equal in length with compression, abandon remaining bit, therefore, if adopt the method for this embodiment, preferably, can coding code table in by the coded data that represents the important informations such as sign bit of quantization parameter come as far as possible list item before, to avoid the reconstruction error of last quantization parameter in subsequent decoding process.
Preferably, adopt the method for entropy coding to encode to quantization parameter, further to improve compression effectiveness.More preferably, when design entropy coding code table, the important informations such as sign bit can be shifted to an earlier date in code word as far as possible, to avoid in subsequent decoding process at the reconstruction error of fixing last quantization parameter under compression budget condition.
Fig. 4 has shown that, according to the structured flowchart of the compressibility of video data of the present invention embodiment, in this embodiment, this system comprises:
Memory 401, storage is divided into a plurality of video datas with the elementary cell of unified specification, and described in each, elementary cell comprises at least one data block;
Input register 402(REG0, REG1, REG2), read and preserve each data block in described elementary cell;
Compression set 403, comprise at least one encoder (ENC0, ENC1, ENC2), by described at least one encoder (ENC0, ENC1, ENC2), each data block in the described elementary cell reading is carried out to compressed encoding concurrently according to specified compression budget separately, the packed data that obtains described each data block, wherein the compression budget of the length of the packed data of each data block and the appointment of this data block is consistent;
Budget allocation controller 404, for each the encoder specified compression budget in compression set 403, and according to this compression budget, determine the packed data (BUD0 of each data block, BUD1, BUD2) position in output buffer, thus the packed data of each data block in the elementary cell reading is assigned in output buffer concurrently;
Output buffer 405, the packed data of described each data block of serial output, thereby the packed data of the elementary cell that acquisition is read; And
Wherein, encoder described in each (ENC0, ENC1, ENC2) carries out discrete cosine transform to data block and obtains coefficient matrix, and the coefficient in coefficient matrix is quantized to obtain a plurality of quantization parameters; And described a plurality of quantization parameters of each data block are encoded one by one, monitor the use state of the compression budget of this data block simultaneously, when the coding result of completed quantization parameter reaches compression budget, stop the coding of current quantization parameter, and abandon the quantization parameter of encoding, using the coding result of the quantization parameter that completed as the packed data of data block.
Preferably, described encoder (ENC0, ENC1, ENC2) can carry out layering to coefficient matrix according to certain principle, and takes different quantization resolutions to quantize to obtain quantization parameter to the coefficient in each layer, thereby further improves compression effectiveness.
Preferably, encoder (ENC0, ENC1, ENC2) is encoded one by one to quantization parameter, and the use state of monitoring compression budget in the process of coding, and according to this state, judges whether to carry out the coding of current quantization parameter.The compression budget that the coding result that can obtain by record takies, or record can with the variety of ways such as remaining compression budget monitor compression budget use state, as long as can make the compression budget that the coding result of each data block is equaled to be scheduled to by monitoring.Preferably, encoder can adopt the process shown in Fig. 3 to carry out the compressed encoding based on predetermined compression ratio to data block.
Preferably, encoder adopts the method for entropy coding to encode to quantization parameter, further to improve compression effectiveness.More preferably, when design entropy coding code table, sign bit information can be shifted to an earlier date in code word as far as possible, to avoid in subsequent decoding process at the reconstruction error of fixing last quantization parameter under compression budget condition.
Fig. 5 has shown that in this embodiment, the method comprises according to the flow chart of the decompression method of video data of the present invention embodiment:
S501 reads the packed data of elementary cell from memory, and the packed data of described elementary cell is by the method in the embodiment of Fig. 1, elementary cell to be compressed and obtained;
S502, the position of the packed data of determining each data block according to the corresponding compression budget of the packed data of each data block in the packed data of described elementary cell in input buffer, thus the packed data of each data block is assigned to each decoder from input buffer concurrently;
S503, decompresses to the packed data of each data block concurrently by each decoder, obtains the decompressed data of described each data block;
S504, the decompressed data of described each data block of output, thus obtain the elementary cell after decompressing;
Wherein, in step S503, the decompression to each data block comprises:
S5031, coding result to the quantization parameter in the packed data of data block is decoded one by one, and monitor the use state of the compression budget of this data block, when complete corresponding to the packed data of the data block of predetermined compression budget decoding time, stop the decoding to this data block;
S5032, carries out inverse quantization and obtains coefficient matrix completing the quantization parameter of decoding, and carry out the decompressed data that inverse discrete cosine transform obtains data block.
Preferably, in step S5031, one by one the coding result of each quantization parameter in the packed data of data block is decoded, and in the process of decoding, monitor the use state of the compression budget of this data block, in fact the compression budget is here exactly the length of the packed data of data block.Can be by the packed data length (completed compression budget) of the complete decoding of monitoring, or monitor the remaining not variety of ways such as packed data length (remaining compression budget) of decoding and monitor the use state of compression budget, as long as can reach by monitoring, guaranteed the decoding to the packed data of predetermined compression budget.
Fig. 6 has described a preferred implementation of the process that the quantization parameter of each data block is decoded, in the embodiment of Fig. 6, before each current quantization parameter to be decoded is decoded, first judge whether remaining compression budget is 0(step S601), if remaining compression budget is 0(step S601: be), stop immediately the decoding of the quantization parameter of this data block (S602), using the decoded result of the quantization parameter completing at present of this data block as the object of follow-up inverse quantization and inverse transformation, if residual compression budget is not 0(S601: no), judge whether residual compression budget is more than or equal to the coding result length (S603) of the current quantization parameter that will decode, if be more than or equal to (S603: be), the current quantization parameter that will decode is decoded, record remaining compression budget, and return to step S601(S604), if be less than (S603: no), whether the coding result that judges again remaining compression Budget correspondence comprises sign bit or other important informations (S605), if comprise sign bit or other important informations (step S605: be), the bit this coding result being dropped in cataloged procedure is decoded after with 0 polishing, obtain the decoded result (S606) of last quantization parameter, if do not comprise sign bit (step 605: no), the decoded result of this last quantization parameter is made as to 0(S607).After completing the decoded result of last quantization parameter, using the decoded result of all quantization parameters of this data block of completing at present as the object of follow-up inverse quantization and inverse transformation, thereby obtain the decompression result of data block.
Due in cataloged procedure, coding result for last quantization parameter may carry out " blocking ", therefore in the embodiment shown in fig. 6, the coding result of last quantization parameter may be incomplete, it may comprise sign bit or not comprise sign bit, for the coding result that does not comprise sign bit, because having abandoned important information, it therefore its decoded result is made as to 0, for the coding result that comprises sign bit, although data are imperfect, still can " with 0 polishing " in cataloged procedure, " be blocked " bit abandoning, and the coding result after polishing is decoded, decoded result as last quantization parameter.Therefore, coding code table in, the important informations such as sign bit of quantization parameter can be come as far as possible list item before, to avoid the reconstruction error of last quantization parameter in subsequent decoding process.
Preferably, adopt the method for entropy coding to encode to quantization parameter, further to improve compression effectiveness.More preferably, when design entropy coding code table, sign bit information can be shifted to an earlier date in code word as far as possible, to avoid in subsequent decoding process at the reconstruction error of fixing last quantization parameter under compression budget condition.
Fig. 7 has shown that, according to the structured flowchart of the decompression systems of video data of the present invention embodiment, in this embodiment, this system comprises:
Memory 701, the packed data of storage elementary cell, the packed data of described elementary cell is by the system in the embodiment of Fig. 4, elementary cell to be compressed and obtained;
Input buffer 702, reads and cushions the packed data of described elementary cell;
Budget allocation controller 703, according to the corresponding compression budget of the packed data of each data block in the packed data of described elementary cell, determine the packed data (BUD0 of each data block, BUD1, BUD2) position in input buffer, thus the packed data of each data block is assigned to each decoder from input buffer concurrently;
Decompressing device 704, comprises at least one decoder (DEC0, DEC1, DEC2), by each decoder (DEC0, DEC1, DEC2) packed data of each data block is decompressed concurrently, obtain the decompressed data of described each data block and offer output register 705;
Output register 705(REG0, REG1, REG2), receive and export the decompressed data of described each data block, thereby obtain the elementary cell after decompressing;
Wherein, decoder (DEC0 described in each, DEC1, DEC2) coding result of the quantization parameter in the packed data of data block is decoded one by one, and monitor the use state of the compression budget of this data block, when complete corresponding to the packed data of the data block of predetermined compression budget decoding time, stop the decoding to this data block; To completing the quantization parameter of decoding, carry out inverse quantization and obtain coefficient matrix, and carry out the decompressed data that inverse discrete cosine transform obtains data block.
Preferably, in each decoder, one by one the coding result of each quantization parameter in the packed data of data block is decoded, and in the process of decoding, monitor the use state of the compression budget of this data block, in fact the compression budget is here exactly the length of the packed data of data block.Can be by the packed data length (completed compression budget) of the complete decoding of monitoring, or monitor the remaining not variety of ways such as packed data length (remaining compression budget) of decoding and monitor the use state of compression budget, as long as can reach by monitoring, guaranteed the decoding to the packed data of predetermined compression budget.Decoder can adopt mode as shown in Figure 6 to carry out the decoding based on fixing compression budget.
Preferably, adopt the method for entropy coding to encode to quantization parameter, further to improve compression effectiveness.More preferably, when design entropy coding code table, sign bit information can be shifted to an earlier date in code word as far as possible, to avoid in subsequent decoding process at the reconstruction error of fixing last quantization parameter under compression budget condition.

Claims (14)

1. a compression method for video data, the method comprises:
1) video data is divided into a plurality of elementary cells with unified specification, described in each, elementary cell comprises at least one data block;
2) read described elementary cell,
3) each data block in the described elementary cell reading is carried out to compressed encoding concurrently according to specified compression budget separately, obtain the packed data of described each data block, wherein the compression budget of the length of the packed data of each data block and the appointment of this data block is consistent
4) position of the packed data of determining each data block according to the compression budget of each data block in output buffer, thus the packed data of each data block in the elementary cell reading is assigned in output buffer concurrently;
5) packed data of described each data block of described output buffer serial output, thereby the packed data of the elementary cell that acquisition is read; And
Wherein, in step 3), for the compressed encoding of each data block, comprise:
3.1) data block is carried out to discrete cosine transform and obtain coefficient matrix, and the coefficient in coefficient matrix is quantized to obtain a plurality of quantization parameters; And
3.2) described a plurality of quantization parameters are encoded one by one, and monitor the use state of the compression budget of this data block, when the coding result of completed quantization parameter reaches the compression budget of this data block, stop the coding of current quantization parameter, and abandon the quantization parameter of encoding, using the coding result of completed quantization parameter as the packed data of data block.
2. the compression method of video data according to claim 1, wherein, in step 3.1) in, described coefficient matrix is carried out to layering, and take different quantization resolutions to quantize to obtain quantization parameter to the coefficient in each layer.
3. the compression method of video data according to claim 1, wherein, step 3.2) comprising:
A) judge whether remaining compression budget is 0, if remaining compression budget is 0, stops immediately the coding to current quantization parameter, and export the coding result of the quantization parameter having completed as the packed data of data block; If remaining compression budget is not 0, enter step b);
B) judge whether remaining compression budget is more than or equal to the length of the coding result of current quantization parameter, if remaining compression budget is more than or equal to the length of the coding result of current quantization parameter, complete the coding of current quantization parameter, record remaining compression budget, and return to step a); Otherwise enter step c);
C) with the length of residual compression budget, block the coding result of current quantization parameter, and export the coding result of all quantization parameters that complete as the packed data of data block.
4. according to the compression method of the video data described in any one in claim 1 to 3, adopt the method for entropy coding to encode to quantization parameter, and sign bit is arranged in to list item front end.
5. according to the compression method of the video data described in any one in claim 1 to 3, with the compression factor of fixing, elementary cell is compressed, obtained having the packed data of the elementary cell of unified size.
6. a compressibility for video data, this system comprises:
Memory, storage is divided into a plurality of video datas with the elementary cell of unified specification, and described in each, elementary cell comprises at least one data block;
Input register, reads and preserves each data block in described elementary cell;
Compression set, comprise at least one encoder, by described at least one encoder, each data block in the described elementary cell reading is carried out to compressed encoding concurrently according to specified compression budget separately, the packed data that obtains described each data block, wherein the compression budget of the length of the packed data of each data block and the appointment of this data block is consistent;
Budget allocation controller, for each the encoder specified compression budget in compression set, and the position of the packed data of determining each data block according to this compression budget in output buffer, thereby the packed data of each data block in the elementary cell reading is assigned in output buffer concurrently;
Output buffer, the packed data of described each data block of serial output, thereby the packed data of the elementary cell that acquisition is read; And
Wherein, described in each, encoder carries out discrete cosine transform to data block and obtains coefficient matrix, and the coefficient in coefficient matrix is quantized to obtain a plurality of quantization parameters; And described a plurality of quantization parameters of each data block are encoded one by one, monitor the use state of the compression budget of this data block simultaneously, when the coding result of completed quantization parameter reaches compression budget, stop the coding of current quantization parameter, and abandon the quantization parameter of encoding, using the coding result of the quantization parameter that completed as the packed data of data block.
7. the compressibility of video data according to claim 6, wherein, described encoder carries out layering to described coefficient matrix, and takes different quantization resolutions to quantize to obtain quantization parameter to the coefficient in each layer.
8. the compressibility of video data according to claim 6, wherein, described encoder is carried out following operation:
A) judge whether remaining compression budget is 0, if remaining compression budget is 0, stops immediately the coding to current quantization parameter, and export the coding result of the quantization parameter having completed as the packed data of data block; If remaining compression budget is not 0, enter step b);
B) judge whether remaining compression budget is more than or equal to the length of the coding result of current quantization parameter, if remaining compression budget is more than or equal to the length of the coding result of current quantization parameter, complete the coding of current quantization parameter, record remaining compression budget, and return to step a); Otherwise enter step c);
C) with the length of residual compression budget, block the coding result of current quantization parameter, and export the coding result of all quantization parameters that complete as the packed data of data block.
9. according to the compressibility of the video data described in any one in claim 6 to 8, adopt the method for entropy coding to encode to quantization parameter, and sign bit is arranged in to list item front end.
10. according to the compressibility of the video data described in any one in claim 6 to 8, with the compression factor of fixing, elementary cell is compressed, obtained having the packed data of the elementary cell of unified size.
The decompression method of 11. 1 kinds of video datas, the method comprises:
1) from memory, read the packed data of elementary cell, the packed data of described elementary cell is by the method for any one in claim 1 to 4, elementary cell to be compressed and obtained;
2) position of the packed data of determining each data block according to the corresponding compression budget of the packed data of each data block in the packed data of described elementary cell in input buffer, thus the packed data of each data block is assigned to each decoder from input buffer concurrently;
3) by each decoder, the packed data of each data block is decompressed concurrently, obtain the decompressed data of described each data block;
4) decompressed data of described each data block of output, thus the elementary cell after decompressing obtained;
Wherein, in step 3), the decompression to each data block comprises:
3.1) coding result of the quantization parameter in the packed data of data block is decoded one by one, and monitor the use state of the compression budget of this data block, when complete corresponding to the packed data of the data block of predetermined compression budget decoding time, stop the decoding to this data block;
3.2) to completing the quantization parameter of decoding, carry out inverse quantization and obtain coefficient matrix, and carry out the decompressed data that inverse discrete cosine transform obtains data block.
The decompression method of 12. video datas according to claim 11, wherein, step 3.1) comprising:
A) judge that whether remaining compression budget is 0, if remaining compression budget is 0, stops the decoding to the quantization parameter of this data block immediately; If remaining compression budget is not 0, enter step b);
B) judge whether remaining compression budget is more than or equal to the coding result length of the current quantization parameter that will decode, if whether remaining compression budget is more than or equal to the coding result length of the current quantization parameter that will decode, the current quantization parameter that will decode is decoded, record remaining compression budget, and return to step a), otherwise enter step c);
Whether the coding result that c) judges remaining compression Budget correspondence comprises sign bit, if comprise sign bit, the bit this coding result being dropped in cataloged procedure is decoded after with 0 polishing, obtain the decoded result of last quantization parameter, if do not comprise sign bit, the decoded result of this last quantization parameter is made as to 0.
The decompression systems of 13. 1 kinds of video datas, this system comprises:
Memory, the packed data of storage elementary cell, the packed data of described elementary cell is by the system described in any one in claim 5 to 8, elementary cell to be compressed and obtained;
Input buffer, reads and cushions the packed data of described elementary cell;
Budget allocation controller, the position of the packed data of determining each data block according to the corresponding compression budget of the packed data of each data block in the packed data of described elementary cell in input buffer, thus the packed data of each data block is assigned to each decoder from input buffer concurrently;
Decompressing device, comprises at least one decoder, by each decoder, the packed data of each data block is decompressed concurrently, obtains the decompressed data of described each data block and offers output register;
Output register, receives and exports the decompressed data of described each data block, thereby obtains the elementary cell after decompressing;
Wherein, described in each, decoder is decoded one by one to the coding result of the quantization parameter in the packed data of data block, and monitor the use state of the compression budget of this data block, when complete corresponding to the packed data of the data block of predetermined compression budget decoding time, stop the decoding to this data block, to completing the quantization parameter of decoding, carry out inverse quantization and obtain coefficient matrix, and carry out the decompressed data that inverse discrete cosine transform obtains data block.
The decompression systems of 14. described video datas according to claim 13, wherein, described encoder is carried out following operation:
A) judge that whether remaining compression budget is 0, if remaining compression budget is 0, stops the decoding to the quantization parameter of this data block immediately; If remaining compression budget is not 0, enter step b);
B) judge whether remaining compression budget is more than or equal to the coding result length of the current quantization parameter that will decode, if whether remaining compression budget is more than or equal to the coding result length of the current quantization parameter that will decode, the current quantization parameter that will decode is decoded, record remaining compression budget, and return to step a), otherwise enter step c);
Whether the coding result that c) judges remaining compression Budget correspondence comprises sign bit, if comprise sign bit, the bit this coding result being dropped in cataloged procedure is decoded after with 0 polishing, obtain the decoded result of last quantization parameter, if do not comprise sign bit, the decoded result of this last quantization parameter is made as to 0.
CN201210277852.6A 2012-08-07 2012-08-07 Video data compression or decompression method and system Pending CN103581673A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210277852.6A CN103581673A (en) 2012-08-07 2012-08-07 Video data compression or decompression method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210277852.6A CN103581673A (en) 2012-08-07 2012-08-07 Video data compression or decompression method and system

Publications (1)

Publication Number Publication Date
CN103581673A true CN103581673A (en) 2014-02-12

Family

ID=50052451

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210277852.6A Pending CN103581673A (en) 2012-08-07 2012-08-07 Video data compression or decompression method and system

Country Status (1)

Country Link
CN (1) CN103581673A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103984528A (en) * 2014-05-15 2014-08-13 中国人民解放军国防科学技术大学 Multithread concurrent data compression method based on FT processor platform
CN105609087A (en) * 2015-12-23 2016-05-25 天津天地伟业数码科技有限公司 Method for processing image for image scaler
CN107566733A (en) * 2017-09-29 2018-01-09 深圳市聚宝汇科技有限公司 A kind of picture transmission method and system
CN110012292A (en) * 2018-01-05 2019-07-12 澜至电子科技(成都)有限公司 Method and apparatus for compressed video data
CN110990358A (en) * 2019-09-30 2020-04-10 咪咕文化科技有限公司 Decompression method, electronic equipment and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1392725A (en) * 2001-06-18 2003-01-22 佳能株式会社 Image processing method and device, computer program and storage medium
CN101087417A (en) * 2006-06-06 2007-12-12 松下电器产业株式会社 Picture coding device
US20080165845A1 (en) * 2006-12-21 2008-07-10 Kismat Singh Method of selecting quantizer values in video compression systems
CN101686388A (en) * 2008-09-24 2010-03-31 国际商业机器公司 Video streaming encoding device and method thereof
CN102724500A (en) * 2012-06-05 2012-10-10 沙基昌 Method and system for compressing/decompressing video data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1392725A (en) * 2001-06-18 2003-01-22 佳能株式会社 Image processing method and device, computer program and storage medium
CN101087417A (en) * 2006-06-06 2007-12-12 松下电器产业株式会社 Picture coding device
US20080165845A1 (en) * 2006-12-21 2008-07-10 Kismat Singh Method of selecting quantizer values in video compression systems
CN101686388A (en) * 2008-09-24 2010-03-31 国际商业机器公司 Video streaming encoding device and method thereof
CN102724500A (en) * 2012-06-05 2012-10-10 沙基昌 Method and system for compressing/decompressing video data

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103984528A (en) * 2014-05-15 2014-08-13 中国人民解放军国防科学技术大学 Multithread concurrent data compression method based on FT processor platform
CN105609087A (en) * 2015-12-23 2016-05-25 天津天地伟业数码科技有限公司 Method for processing image for image scaler
CN105609087B (en) * 2015-12-23 2018-11-16 天地伟业技术有限公司 A kind of method of image sealer processing image
CN107566733A (en) * 2017-09-29 2018-01-09 深圳市聚宝汇科技有限公司 A kind of picture transmission method and system
CN110012292A (en) * 2018-01-05 2019-07-12 澜至电子科技(成都)有限公司 Method and apparatus for compressed video data
CN110990358A (en) * 2019-09-30 2020-04-10 咪咕文化科技有限公司 Decompression method, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN102724500B (en) A kind of compressing/decompressing method of video data and system
RU2503138C2 (en) Embedded graphics coding for images with sparse histograms
CN101420614B (en) Image compression method and device integrating hybrid coding and wordbook coding
CN103581673A (en) Video data compression or decompression method and system
CN103404141A (en) Video encoding and decoding using transforms
CN103262534A (en) Method and apparatus for improved entropy encoding and decoding
KR20200052201A (en) Lossy compression of neural network activation maps
CN102845065A (en) Methods and devices for reordered parallel entropy coding and decoding
CN101751440A (en) Data compression/decompression method and device thereof
CN111641826B (en) Method, device and system for encoding and decoding data
CN102939719A (en) Methods and devices for reducing sources in binary entropy coding and decoding
CN103581680A (en) Method and system for improving decoder performance through quantization control
CN103188494A (en) Apparatus and method for encoding depth image by skipping discrete cosine transform (DCT), and apparatus and method for decoding depth image by skipping DCT
CN103841424A (en) System And Method For Randomly Accessing Compressed Data From Memory
CN103716634A (en) Method and apparatus for data compression using error plane coding
CN100571393C (en) A kind of bit rate control method and device based on characteristics of image
CN110062231A (en) Method for compressing image based on multilayer convolutional neural networks
CN101546434A (en) Method and system for compressing and decompressing BMP picture file
CN101778278A (en) Image encoder and image encoding method
CN1725858A (en) The equipment and the method that are used for the control bit rate
CN102238376B (en) Image processing system and method
CN102740075B (en) Video data compressing/decompressing method and system
CN103581675A (en) Video data compression or decompression method and system
US9948928B2 (en) Method and apparatus for encoding an image
CN202907104U (en) Compression and decompression system of video data

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
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140212