RU2579966C1 - Method of image compressing (versions) - Google Patents
Method of image compressing (versions) Download PDFInfo
- Publication number
- RU2579966C1 RU2579966C1 RU2014148851/08A RU2014148851A RU2579966C1 RU 2579966 C1 RU2579966 C1 RU 2579966C1 RU 2014148851/08 A RU2014148851/08 A RU 2014148851/08A RU 2014148851 A RU2014148851 A RU 2014148851A RU 2579966 C1 RU2579966 C1 RU 2579966C1
- Authority
- RU
- Russia
- Prior art keywords
- values
- binary
- value
- prediction error
- error
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 66
- 230000006835 compression Effects 0.000 claims abstract description 36
- 238000007906 compression Methods 0.000 claims abstract description 36
- 238000004088 simulation Methods 0.000 abstract 1
- 239000000126 substance Substances 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 10
- 230000003044 adaptive effect Effects 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
Images
Landscapes
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
ОБЛАСТЬ ТЕХНИКИFIELD OF TECHNOLOGY
Изобретения относятся к области обработки изображений, точнее к сжатию изображений без потерь с помощью кодирования данных.The invention relates to the field of image processing, more specifically to lossless image compression using data encoding.
ПРЕДШЕСТВУЮЩИЙ УРОВЕНЬ ТЕХНИКИBACKGROUND OF THE INVENTION
Наиболее известными способами сжатия изображений без потерь являются стандарты JPEG-LS, JPEG-2000 и алгоритм сжатия изображений CALIC.The most well-known lossless image compression methods are JPEG-LS, JPEG-2000 and the CALIC image compression algorithm.
Алгоритм LOCO-I из стандарта JPEG-LS ("lnformation Technology Lossless and Near-lossless Compression of Continuous-Tone Still Images: Baseline," ISO/IEC, ISO/IEC 14495-1:1999), также описанный в патентных заявках US 5764374, публ. 09.06.1998 и US 5680129, публ. 21.10.1997, содержит следующие операции: выбор режима кодирования пикселя на основе значений соседей, адаптивное предсказание, режим кодирования длин серий, контекстное моделирование значений ошибок предсказания, процедура выбора параметров кодов Голомба. Адаптивное предсказание, используемое в LOCO-I алгоритме, может использоваться для формирования ошибок предсказания в заявленном способе, но процедура кодирования самих ошибок предсказания в заявленном способе существенно отличается от представленной в алгоритме LOCO-I. В частности, значения ошибок в заявленном способе представляются в виде пар значений модуля и знака ошибки предсказания с последующим кодированием, в LOCO-I алгоритме диапазон значений сокращается с помощью модульной арифметики, а сами значения отображаются в положительную полуплоскость перед кодированием.LOCO-I algorithm from JPEG-LS standard ("lnformation Technology Lossless and Near-lossless Compression of Continuous-Tone Still Images: Baseline," ISO / IEC, ISO / IEC 14495-1: 1999), also described in patent applications US 5764374 publ. 06/09/1998 and US 5680129, publ. 10.21.1997, contains the following operations: selection of a pixel coding mode based on neighbor values, adaptive prediction, series length coding mode, context modeling of prediction error values, procedure for selecting parameters of Golomb codes. The adaptive prediction used in the LOCO-I algorithm can be used to generate prediction errors in the claimed method, but the procedure for encoding the prediction errors themselves in the claimed method is significantly different from that presented in the LOCO-I algorithm. In particular, the error values in the inventive method are represented as pairs of module values and the sign of the prediction error with subsequent coding, in the LOCO-I algorithm, the range of values is reduced using modular arithmetic, and the values themselves are mapped to the positive half-plane before encoding.
Алгоритм сжатия без потерь CALIC по заявке US 5903676, публ. 11.05.1999, содержит операции: предсказание значения текущего пиксела по окружению, классификацию контекста, контекстное моделирование ошибки предсказания и ее коррекция, а также энтропийное кодирование скорректированной ошибки предсказания. Изобретение CALIC разработано для сжатия 8-ми битных однокомпонентных изображений, тем самым, в настоящее время область его применения сильно ограничена.The lossless compression algorithm CALIC according to the application US 5903676, publ. 05/11/1999, contains operations: predicting the value of the current pixel by environment, context classification, context modeling of the prediction error and its correction, as well as entropy coding of the corrected prediction error. The CALIC invention was developed for compressing 8-bit single-component images, thus, at present, its scope is very limited.
Предложенная схема кодирования содержит схожий набор операций, но имеет принципиальные различия в их исполнении. В предложенной схеме предсказания отсутствуют операции умножения и деления, что положительно сказывается на производительности схемы. Контекстное моделирование в предложенной схеме выполняется по двоичным данным битовых плоскостей и строго по ошибкам предсказания, в то время как в изобретении CALIC для моделирования используются как значения ошибок предсказания, так и значения пикселей изображения в их оригинальном представлении. В предложенном изобретении отсутствует процедура уточнения ошибок предсказания. В предложенной схеме кодирование знаков и модулей ошибок предсказания выполняется независимо, что кардинально отличает ее от последовательности операций, предложенной в изобретении CALIC, где кодирование модулей ошибок и знаков выполняется совместно.The proposed coding scheme contains a similar set of operations, but has fundamental differences in their execution. In the proposed prediction scheme, there are no operations of multiplication and division, which positively affects the performance of the scheme. Context modeling in the proposed scheme is performed using binary data of bit planes and strictly according to prediction errors, while the CALIC invention uses both prediction error values and image pixel values in their original representation for modeling. In the proposed invention there is no procedure for clarifying prediction errors. In the proposed scheme, the coding of signs and prediction error modules is performed independently, which radically distinguishes it from the sequence of operations proposed in the CALIC invention, where the coding of error modules and signs is performed together.
Наиболее близким к заявляемому изобретению является стандарт JPEG-2000 ("Information Technology JPEG 2000 image coding system: Core coding system," ISO/IEC 15444-1:2004, Dec. 2009), содержащий описание способа сжатия изображений, имеющий специальный режим для сжатия без потерь, состоящих из следующих операций: процедуры представления кодируемых значений в виде битовых плоскостей и послойного энтропийного кодирования значений из битовых слоев, в котором используется контекстное моделирование и двоичный арифметический кодер - MQ кодер. Концепция представления значений в виде двоичных слоев с последующим кодированием схожа с процедурой кодирования из заявленного способа сжатия. Но, в отличие от алгоритма сжатия из стандарта JPEG-2000, в заявленном способе кодирования изображений описываемая методика представления значений в виде двоичных слоев позволяет использовать данные из ранее обработанных слоев при выполнении контекстного моделирования для значений модулей ошибок предсказания для повышения степени сжатия обрабатываемых данных.Closest to the claimed invention is the standard JPEG-2000 ("Information Technology JPEG 2000 image coding system: Core coding system," ISO / IEC 15444-1: 2004, Dec. 2009), which contains a description of the image compression method having a special mode for compression lossless, consisting of the following operations: procedures for representing encoded values in the form of bit planes and layer-by-layer entropy encoding of values from bit layers, which uses context modeling and a binary arithmetic encoder - MQ encoder. The concept of representing values in the form of binary layers with subsequent encoding is similar to the encoding procedure from the claimed compression method. But, unlike the compression algorithm from the JPEG-2000 standard, in the claimed image encoding method, the described method of representing values in the form of binary layers allows the use of data from previously processed layers when performing context modeling for values of prediction error modules to increase the degree of compression of the processed data.
Несмотря на то, что достигнуты значительные успехи в сжатии изображений, остается актуальной задача разработки новых способов сжатия изображений.Despite the fact that significant success has been achieved in image compression, the task of developing new methods of image compression remains urgent.
РАСКРЫТИЕ ИЗОБРЕТЕНИЯSUMMARY OF THE INVENTION
Заявляемые изобретения связаны единым изобретательским замыслом.The claimed inventions are connected by a single inventive concept.
Техническим результатом заявляемого первого изобретения является метод сжатия изображений без потерь с высокой степенью сжатия.The technical result of the claimed first invention is a lossless image compression method with a high compression ratio.
Первый способ сжатия изображений характеризуется тем, что первоначально, для каждого из пикселей входного изображения, определяют значение ошибки предсказания, которую затем формируют в виде пары значений: значение модуля ошибки предсказания и значение знака ошибки предсказания. Затем отображают значение модуля ошибки каждого из пикселей всего изображения в двоичную последовательность в соответствии с унарным кодом. Полученный набор двоичных последовательностей представляют в виде набора двоичных уровней, сформированных из двоичных значений, чьи порядковые позиции в коде совпадают с номером соответствующего двоичного уровня. На каждом двоичном уровне производят контекстное моделирование для каждого бита, используя значения бит отображения значений модулей ошибок соседних пикселей на данном и предыдущем двоичном уровне унарного кода. Далее производят контекстное моделирование для значений знаков ошибки каждого пикселя изображения, используя значения знаков ошибок предсказания соседних пикселей. И затем сформированные с помощью контекстного моделирования, выполняемого для значений модулей и знаков ошибок предсказания, двоичные потоки обрабатывают путем сжатия двоичным арифметическим кодером.The first image compression method is characterized in that initially, for each of the pixels of the input image, a prediction error value is determined, which is then generated as a pair of values: the value of the prediction error modulus and the value of the prediction error sign. Then, the error modulus value of each of the pixels of the entire image is displayed in a binary sequence in accordance with the unary code. The resulting set of binary sequences is represented as a set of binary levels formed from binary values whose ordinal positions in the code coincide with the number of the corresponding binary level. At each binary level, contextual modeling is performed for each bit, using the bit values of the display of the values of the error modules of neighboring pixels at this and the previous binary level of the unary code. Next, contextual modeling is performed for the error sign values of each pixel of the image, using the values of the prediction error signs of neighboring pixels. And then generated using context modeling performed for the values of the modules and signs of the prediction errors, the binary streams are processed by compression with a binary arithmetic encoder.
В частном случае при формировании значения знака ошибки предсказания учитывают значение модуля ошибки предсказания для этого же пикселя. При значении модуля, равном «0», значение знака не кодируют.In the particular case, when generating the value of the prediction error sign, the value of the prediction error modulus for the same pixel is taken into account. When the value of the module equal to "0", the value of the sign is not encoded.
При отображении значения модуля ошибки каждого из пикселей в унарный код формируют двоичную последовательность, в которой количество «0» соответствует значению модуля ошибки и служебного значения «1» в конце последовательности из «0».When displaying the value of the error modulus of each of the pixels in a unary code, a binary sequence is formed in which the number “0” corresponds to the value of the error modulus and the service value “1” at the end of the sequence of “0”.
Также производят обработку значений из двоичных уровней, один уровень за другим, начиная с уровня, сформированного из двоичных значений, выбранных с первой порядковой позиции унарного кода модуля ошибки предсказания каждого пикселя.They also process values from binary levels, one level after another, starting from a level formed from binary values selected from the first ordinal position of the unary code of the prediction error module for each pixel.
Кроме того, производят обработку значений из двоичного уровня только на тех позициях, на которых присутствуют значения двоичного кода модуля ошибки предсказания. Таким образом, на двоичных уровнях, расположенных выше двоичного уровня, на котором в данной позиции находилась "1", эта позиция не будет обрабатываться.In addition, they process values from the binary level only at those positions where binary values of the prediction error module are present. Thus, at binary levels located above the binary level at which “1” was in this position, this position will not be processed.
В частности, информацию о позициях, на которых находятся обрабатываемые значения, передают от предыдущего обработанного двоичного уровня.In particular, information about the positions at which the processed values are located is transmitted from the previous processed binary level.
При контекстном моделировании, выполняемом для каждого бита, подвергающегося кодированию на текущем уровне, в одном случае используют биты отображения значений модулей ошибок четырех ближайших пикселей с текущего двоичного уровня, которые расположены левее и выше текущей позиции, а также четырех ближайших пикселей с предыдущего двоичного уровня, которые расположены правее и ниже текущей позиции.In context modeling performed for each bit subjected to coding at the current level, in one case, bits are used to display the error modulus values of the four nearest pixels from the current binary level, which are located to the left and above the current position, as well as the four nearest pixels from the previous binary level, which are located to the right and below the current position.
При контекстном моделировании, выполняемом для каждого бита, подвергающегося кодированию на текущем уровне, в другом случае используют биты отображения значений модулей ошибок десяти ближайших пикселей с текущего двоичного уровня, которые расположены левее и выше текущей позиции, а также десяти ближайших пикселей с предыдущего двоичного уровня, которые расположены правее и ниже текущей позиции.In contextual modeling performed for each bit subjected to coding at the current level, in another case, bits are used to display the error modulus values of the ten nearest pixels from the current binary level, which are located to the left and above the current position, as well as the ten nearest pixels from the previous binary level, which are located to the right and below the current position.
При контекстном моделировании, выполняемом для значений знаков ошибок предсказания, в одном случае используют значения знаков четырех ближайших уже обработанных ошибок предсказания.In context modeling performed for the values of the signs of the prediction errors, in one case, the values of the signs of the four nearest already processed prediction errors are used.
При контекстном моделировании, выполняемом для значений знаков ошибок предсказания, в другом случае используют значения знаков шести ближайших уже обработанных ошибок предсказания.In context modeling performed for the sign values of the prediction errors, in another case, the sign values of the six closest prediction errors already processed are used.
Техническим результатом заявляемого второго изобретения является повышение скорости кодирования без потерь изображения по сравнению с первым изобретением при несущественных изменениях степени сжатия изображений, особенно при обработке изображений с большим динамическим диапазоном по яркости.The technical result of the claimed second invention is to increase the encoding speed without loss of image compared to the first invention with minor changes in the degree of image compression, especially when processing images with a large dynamic range in brightness.
Второй способ сжатия изображений характеризуется тем, что первоначально, для каждого из пикселей входного изображения, определяют значение ошибки предсказания, которое затем формируют в виде пары значений: значение модуля ошибки предсказания и значение знака ошибки предсказания. Далее отображают значение модуля ошибки каждого из пикселей всего изображения в двоичную последовательность в соответствии с унарным кодом. Полученный набор двоичных последовательностей представляют в виде набора двоичных уровней, сформированных из двоичных значений, чьи порядковые позиции в коде совпадают с номером соответствующего двоичного уровня. Следом производят контекстное моделирование для каждого бита, используя значения бит отображения значений модулей ошибок соседних пикселей на данном и предыдущем двоичном уровне унарного кода для тех двоичных уровней, для которых значение модуля ошибки предсказания изображения не превышает определенный порог. На остальных двоичных уровнях необработанные значения преобразуют в двоичный код и производят контекстное моделирование для значений полученного двоичного кода. Производят контекстное моделирование для значений знаков ошибки предсказания для каждого пикселя изображения с учетом значений знаков ошибки предсказания соседних пикселей. И затем сформированные с помощью контекстного моделирования, выполняемого для значений модулей и знаков ошибок предсказания, двоичные потоки обрабатывают путем сжатия двоичным арифметическим кодером.The second image compression method is characterized in that initially, for each of the pixels of the input image, a prediction error value is determined, which is then generated as a pair of values: the value of the prediction error modulus and the value of the prediction error sign. Next, the error modulus value of each of the pixels of the entire image is displayed in a binary sequence in accordance with a unary code. The resulting set of binary sequences is represented as a set of binary levels formed from binary values whose ordinal positions in the code coincide with the number of the corresponding binary level. Next, contextual modeling is performed for each bit, using the values of the bits for displaying the values of the error modules of neighboring pixels at this and the previous binary level of the unary code for those binary levels for which the value of the image prediction error module does not exceed a certain threshold. At the other binary levels, the raw values are converted into binary code and contextualized for the values of the resulting binary code. Context modeling is performed for the prediction error sign values for each image pixel, taking into account the prediction error sign values of neighboring pixels. And then generated using context modeling performed for the values of the modules and signs of the prediction errors, the binary streams are processed by compression with a binary arithmetic encoder.
В частном случае при формировании значения знака ошибки предсказания учитывают значение модуля ошибки предсказаний для этого же пикселя. При значении модуля, равном «0», значение знака не кодируют.In the particular case, when generating the value of the prediction error sign, the value of the prediction error modulus for the same pixel is taken into account. When the value of the module equal to "0", the value of the sign is not encoded.
При отображении значения модуля ошибок каждого из пикселей в унарный код формируют двоичную последовательность, в которой количество «0» соответствует значению модуля ошибки, и служебного значения «1» в конце последовательности из «0».When displaying the value of the error module of each of the pixels in a unary code, a binary sequence is formed in which the number “0” corresponds to the value of the error module and the service value “1” at the end of the sequence of “0”.
Также производят обработку значений из двоичных уровней, один уровень за другим, начиная с уровня, сформированного из двоичных значений, выбранных с первой порядковой позиции унарного кода модуля ошибки предсказания каждого пикселя.They also process values from binary levels, one level after another, starting from a level formed from binary values selected from the first ordinal position of the unary code of the prediction error module for each pixel.
Кроме того, производят обработку значений из двоичного уровня только на тех позициях, на которых присутствуют значения двоичного кода модуля ошибки предсказания. Таким образом, на двоичных уровнях, расположенных выше двоичного уровня, на котором в данной позиции находилась "1", эта позиция не будет обрабатываться.In addition, they process values from the binary level only at those positions where binary values of the prediction error module are present. Thus, at binary levels located above the binary level at which “1” was in this position, this position will not be processed.
В частности, информацию о позициях, на которых находятся обрабатываемые значения, передают от предыдущего обработанного двоичного уровня.In particular, information about the positions at which the processed values are located is transmitted from the previous processed binary level.
При контекстном моделировании, выполняемом для значений модулей ошибок каждого пикселя, в одном случае используют биты отображения значений модулей ошибок четырех ближайших пикселей с текущего двоичного уровня, которые расположены левее и выше текущей позиции, а также четырех ближайших пикселей с предыдущего двоичного уровня, которые расположены правее и ниже текущей позиции.In contextual modeling performed for the error modulus values of each pixel, in one case, bits are used to display the error modulus values of the four nearest pixels from the current binary level, which are located to the left and above the current position, as well as the four nearest pixels from the previous binary level, which are located to the right and below the current position.
При контекстном моделировании, выполняемом для значений модулей ошибок каждого пикселя, в другом случае используют биты отображения значений модулей ошибок десяти ближайших пикселей с текущего двоичного уровня, которые расположены левее и выше текущей позиции, а также десяти ближайших пикселей с предыдущего двоичного уровня, которые расположены правее и ниже текущей позиции.In context modeling performed for the error modulus values of each pixel, in the other case, the bits of the error modulus values of the ten nearest pixels from the current binary level, which are located to the left and above the current position, as well as the ten nearest pixels from the previous binary level, which are located to the right, are used and below the current position.
При контекстном моделировании, выполняемом для значений знаков ошибок предсказания каждого пикселя, в одном случае используют значения знаков четырех ближайших уже обработанных ошибок предсказания.In context modeling performed for the sign values of the prediction errors of each pixel, in one case, the sign values of the four nearest already processed prediction errors are used.
При контекстном моделировании, выполняемом для значений знаков ошибок предсказания каждого пикселя, в другом случае используют значения знаков шести ближайших уже обработанных ошибок предсказания.In context modeling performed for the sign values of the prediction errors of each pixel, in the other case, the sign values of the six closest already processed prediction errors are used.
Кроме того, упомянутый порог при выполнении контекстного моделирования определяют заранее и считают параметром, задаваемым пользователем с целью управления скоростью работы алгоритма сжатия.In addition, the said threshold when performing contextual modeling is determined in advance and is considered a parameter set by the user in order to control the speed of the compression algorithm.
При этом значения из двоичных уровней, составленных из значений унарного кода, чьи порядковые номера в коде превышают заданный порог, отображаются в двоичные последовательности в соответствии с равномерным кодом.In this case, the values from binary levels composed of the values of the unary code, whose sequence numbers in the code exceed the specified threshold, are displayed in binary sequences in accordance with the uniform code.
При контекстном моделировании, выполняемом для значений полученного двоичного кода, используют информацию о позиции двоичного значения в равномерном коде.In contextual modeling performed for the values of the obtained binary code, information about the position of the binary value in the uniform code is used.
КРАТКОЕ ОПИСАНИЕ ЧЕРТЕЖЕЙBRIEF DESCRIPTION OF THE DRAWINGS
Изобретение поясняется рисунками.The invention is illustrated by drawings.
На Фиг. 1 приведена общая структурная схема выполнения способа сжатия изображения.In FIG. 1 shows a general block diagram of an image compression method.
На Фиг. 2 представлена схема формирования модуля ошибки предсказания и знака ошибки предсказания.In FIG. 2 shows a diagram for generating a prediction error modulus and a prediction error sign.
На Фиг. 3 представлена схема операций по обработке значений модулей ошибок предсказания по первому изобретению.In FIG. 3 is a flowchart of processing values of prediction error moduli according to the first invention.
На Фиг. 4 представлена схема операций по обработке значений модулей ошибок предсказания по второму изобретению.In FIG. 4 is a flow diagram of processing values of prediction error units in the second invention.
На Фиг. 5 приведен рисунок, поясняющий процесс формирования набора двоичных уровней по значениям модулей ошибок предсказания.In FIG. 5 is a drawing explaining the process of generating a set of binary levels from the values of the prediction error modules.
На Фиг. 6 представлен рисунок, поясняющий порядок обработки двоичных уровней.In FIG. 6 is a drawing explaining the processing order of binary levels.
На Фиг. 7 представлена схема, демонстрирующая набор доступных значений при контекстном моделировании.In FIG. 7 is a diagram showing a set of available values in context modeling.
На Фиг. 8 представлена схема контекстного моделирования для значений знаков ошибок предсказания по первому варианту осуществления контекстного моделирования.In FIG. 8 is a context modeling diagram for prediction error sign values according to a first embodiment of context modeling.
На Фиг. 9 представлена схема контекстного моделирования для значений знаков ошибок предсказания по второму варианту осуществления контекстного моделирования.In FIG. 9 is a contextual modeling diagram for prediction error sign values according to a second embodiment of contextual modeling.
На Фиг. 10 представлена схема контекстного моделирования для значений двоичного уровня по первому варианту осуществления контекстного моделирования.In FIG. 10 is a context modeling diagram for binary values according to a first embodiment of context modeling.
На Фиг. 11 представлена схема контекстного моделирования для значений двоичного уровня по второму варианту осуществления контекстного моделирования.In FIG. 11 is a context modeling diagram for binary values according to a second embodiment of context modeling.
На Фиг. 12 представлена схема контекстного моделирования для значений двоичного уровня по третьему варианту осуществления контекстного моделирования.In FIG. 12 is a context modeling diagram for binary values according to a third embodiment of context modeling.
ВАРИАНТЫ ОСУЩЕСТВЛЕНИЯ ИЗОБРЕТЕНИЯMODES FOR CARRYING OUT THE INVENTION
Данный способ может применяться для изображений, состоящих из одной компоненты, например, черно-белых изображений, или из нескольких компонент 1, 2, 3 в случае цветных изображений (Фиг. 1). Для RGB изображений этими компонентами будет являться зеленая, красная и синяя соответственно. В данном способе наборы ошибок предсказания, сформированные по различным цветовым компонентам, сжимаются независимо.This method can be applied to images consisting of a single component, for example, black and white images, or from
Работа способа по первой реализации изобретения осуществляется следующим образом.The method for the first implementation of the invention is as follows.
Изображение состоит из отдельных пикселей. Первоначально для каждого пикселя формируют 4 (Фиг. 1) значение ошибки предсказания, которое представляет собой разницу между значением яркостной составляющей пикселя и предсказанным значением. В качестве процедуры формирования ошибки предсказания может использоваться методика, описанная в одном из известных стандартов сжатия изображений (смотри, например, MED предсказание из стандарта сжатия изображений без потерь JPEG-LS).The image consists of individual pixels. Initially, for each pixel, 4 (Fig. 1) is formed of a prediction error value, which is the difference between the value of the brightness component of the pixel and the predicted value. As a procedure for generating prediction errors, the technique described in one of the known image compression standards can be used (see, for example, MED prediction from the lossless JPEG-LS image compression standard).
Далее производится вторая часть - кодирование ошибок предсказания 5. Первоначально (Фиг. 2) с помощью мультиплексора 6 из каждой ошибки предсказания формируют пару значений: значение модуля ошибки предсказания и значение знака ошибки предсказания. При формировании значения знака ошибки предсказания учитывают значение модуля ошибки предсказания для этого же пикселя. При значении модуля, равном «0», значение знака не кодируют. Дальнейшая обработка модулей ошибок предсказания 7 и обработка знаков ошибок предсказания 8 производится раздельно.Next, the second part is performed - coding of
При обработке значений модулей ошибок предсказаний первоначально отображают значение модуля ошибки каждого из пикселей всего изображения в двоичную последовательность в соответствии с унарным кодом (Фиг. 3). На Фиг. 5 представлен пример отображения значений модулей ошибок в унарный код. В получаемой двоичной последовательности количество «0» соответствует значению модуля ошибки предсказания. Кроме того, в конце последовательности из «0» записывается служебное значение «1». Полученные последовательности представлены на диаграмме в виде столбцов.When processing the values of the prediction error modules, the value of the error module of each of the pixels of the entire image is initially displayed in a binary sequence in accordance with the unary code (Fig. 3). In FIG. Figure 5 shows an example of mapping error module values into a unary code. In the resulting binary sequence, the number “0” corresponds to the value of the prediction error modulus. In addition, at the end of the sequence of "0" is written service value "1". The obtained sequences are presented in the diagram in the form of columns.
Полученный набор двоичных последовательностей представляют в виде набора двоичных уровней 10, сформированных из двоичных значений, чьи порядковые позиции в коде совпадают с номером соответствующего двоичного уровня. Дальнейшая обработка значений из двоичных уровней производится по уровням, один за другим, начиная с уровня, сформированного из двоичных значений, выбранных с первой порядковой позиции унарного кода модуля ошибки предсказания каждого пикселя. Эта процедура схематически показана на Фиг. 6. В нижней части рисунка показаны двоичные последовательности с 1 (первого) по 5 (пятый) уровень. В верхней части рисунка Фиг. 6. показаны двоичные последовательности с 6 (шестого) по 14 (четырнадцатый) уровень. Также приведен пример значений
Контекстное моделирование предполагает разделение исходного потока данных на подпотоки, которые будут в дальнейшем обрабатываться независимо. При контекстном моделировании, выполняемом для значения двоичного уровня на позиции «X», соседние двоичные значения с позиций, изображенных на Фиг. 7, могут использоваться в качестве контекста пикселя на позиции «X». На Фиг. 7 белым цветом выделены позиции двоичных значений, взятых с текущего двоичного уровня, а серым цветом - с предыдущего уровня. Контекстная модель для обрабатываемого значения определяется идентификационным номером, вычисляемым как количество нулевых соседей в контексте текущего обрабатываемого значения. Идентификационный номер контекстной модели вычисляется по следующей формуле:Context modeling involves dividing the original data stream into sub-streams, which will be further processed independently. In context modeling performed for a binary level value at the “X” position, adjacent binary values from the positions shown in FIG. 7 may be used as the context of the pixel at position “X”. In FIG. 7 the positions of binary values taken from the current binary level are highlighted in white, and gray from the previous level. The context model for the processed value is determined by the identification number, calculated as the number of zero neighbors in the context of the current processed value. The context model identification number is calculated using the following formula:
, ,
где Ni,j - множество соседних позиций, значения на которых используются в качестве контекста;where N i, j is the set of neighboring positions, the values of which are used as context;
I(.,.)- следующая функция индикатор:I (.,.) - the following indicator function:
В первом варианте осуществления контекстного моделирования, выполняемого для значения модуля ошибки предсказания каждого пикселя, в качестве контекста используют биты отображения значений модулей ошибок с позиций, выделенных серым цветом на Фиг. 10. На Фиг. 10 позиции соседних значений n, m заменены на буквенные представления: Ni,j∈{А, В, С, D, Е, F, G, Н}.In the first embodiment of the context modeling performed for the value of the prediction error modulus of each pixel, bits of the mapping of the values of the error moduli from the positions highlighted in gray in FIG. 10. In FIG. 10 positions of adjacent values of n, m are replaced by letter representations: N i, j ∈ {A, B, C, D, E, F, G, H}.
Во втором варианте осуществления контекстного моделирования, выполняемого для значения модуля ошибки предсказания каждого пикселя, в качестве контекста используют биты отображения значений модулей ошибок с позиций, выделенных серым цветом на Фиг. 11. Что означает следующее:In a second embodiment of the context modeling performed for the value of the prediction error modulus of each pixel, bits for displaying the values of the error moduli from the positions highlighted in gray in FIG. 11. What does the following mean:
Ni,j ∈{A, B, C, D, E, F, G, H, NN, NNE, NEE, EE, SEE, SSE, SS, SSW, SWW, WW, NWW, NNW}.N i, j ∈ {A, B, C, D, E, F, G, H, NN, NNE, NEE, EE, SEE, SSE, SS, SSW, SWW, WW, NWW, NNW}.
В третьем варианте осуществления контекстного моделирования, выполняемого для значения модуля ошибки предсказания каждого пикселя, используется схема двухуровневого контекстного моделирования, т.е. сначала на основе контекста
Как было сказано выше, значение знака ошибки предсказания каждого пикселя обрабатывается независимо от значения модуля ошибки предсказания этого же пикселя. (Фиг. 2, Фиг. 3). При контекстном моделировании, выполняемом для значений знаков ошибок предсказания 12, используют значения знаков ближайших уже обработанных пикселей в качестве контекста. Идентификационный номер контекстной модели определяется размещением соседних знаков ошибок предсказаний и вычисляется по следующей формуле:As mentioned above, the value of the prediction error sign of each pixel is processed regardless of the value of the prediction error modulus of the same pixel. (Fig. 2, Fig. 3). In the context modeling performed for the sign values of the
, ,
где |Sign| - мощность множества значений знаков ошибки предсказания (равна трем);where | Sign | - the power of the set of values of the signs of the prediction error (equal to three);
sign(.,.) - значение знака ошибки предсказания на позицииsign (.,.) - value of the sign of the prediction error at the position
z(.,.) - индекс, указывающий на позицию используемого значения в контексте.z (.,.) is an index indicating the position of the value used in the context.
В одном варианте осуществления контекстного моделирования, выполняемого для значения модуля ошибки предсказания каждого пикселя, используют значения знаков четырех ближайших уже обработанных пикселей с позиций, выделенных серым цветом на Фиг. 8. Что означает следующее: Ni,j∈{А, В, С, D}In one embodiment of the context modeling performed for the value of the prediction error modulus of each pixel, the sign values of the four nearest already processed pixels from the positions highlighted in gray in FIG. 8. Which means the following: N i, j ∈ {A, B, C, D}
В другом варианте осуществления контекстного моделирования, выполняемого для значения модуля ошибки предсказания каждого пикселя, используют значения знаков шести ближайших уже обработанных пикселей с позиций, выделенных серым цветом на Фиг. 9. Что означает следующее: Ni,j∈{А, В, С, D, WW, NN}In another embodiment of the context modeling performed for the value of the prediction error modulus of each pixel, the sign values of the six nearest pixels already processed from the positions highlighted in gray in FIG. 9. Which means the following: N i, j ∈ {A, B, C, D, WW, NN}
Далее сформированные с помощью контекстного моделирования по значениям модулей и знаков ошибок предсказания двоичные потоки обрабатывают (Фиг. 3) путем сжатия арифметическим кодером 13. Данная операция производится известными методами. В качестве примера использования данной методики для сжатия потоков данных, сформированных с помощью контекстного моделирования, можно рассмотреть процедуры (методы) кодирования из стандарта сжатия неподвижных изображений JPEG-2000 ("Information Technology JPEG 2000 image coding system: Core coding system," ISO/IEC 15444-1:2004, Dec. 2009) и стандарта сжатия видеопоследовательностей Н.264 (" The Н.264 Advanced Video Compression Standard", lain E. Richardson, ISBN: 978-0-470-51692-8, 2010).Next, the binary streams generated by context modeling using the values of the moduli and the signs of the prediction errors are processed (Fig. 3) by compression by the
Вторая реализация изобретения показана на Фиг. 4. Данное изобретение от первого отличается только тем, что процедура контекстного моделирования 101 производится только для двоичных уровней, сформированных из двоичных значений унарного кода, чьи порядковые позиции в коде не превышают заданный порог. Упомянутый порог при выполнении контекстного моделирования определяют заранее и считают параметром, задаваемым пользователем с целью управления скоростью работы алгоритма сжатия. На остальных двоичных уровнях необработанные значения преобразуют в двоичный код 102 и производят контекстное моделирование для значений полученного двоичного кода 103.A second embodiment of the invention is shown in FIG. 4. The present invention differs from the first only in that the
При этом значения из двоичных уровней, составленных из значений унарного кода, чьи порядковые номера в коде превышают заданный порог, отображаются в двоичные последовательности в соответствии с равномерным кодом.In this case, the values from binary levels composed of the values of the unary code, whose sequence numbers in the code exceed the specified threshold, are displayed in binary sequences in accordance with the uniform code.
При контекстном моделировании, выполняемом для значений полученного двоичного кода, используют информацию о позиции двоичного значения в равномерном коде.In contextual modeling performed for the values of the obtained binary code, information about the position of the binary value in the uniform code is used.
Далее сформированные с помощью контекстного моделирования по значениям модулей и знаков ошибок предсказания двоичные потоки обрабатывают путем сжатия арифметическим кодером, по аналогии с первой реализацией изобретения.Next, the binary streams generated by context modeling by the values of the moduli and the signs of the prediction errors are processed by compression by an arithmetic encoder, by analogy with the first implementation of the invention.
ПРОМЫШЛЕННАЯ ПРИМЕНИМОСТЬINDUSTRIAL APPLICABILITY
Изобретения могут применяться для сжатия изображений в самых различных областях техники, в том числе для сжатия неподвижных изображений и видеопоследовательностей. Наиболее эффективно применение данных способов для сжатия натуралистичных и медицинских изображений.The invention can be used to compress images in various fields of technology, including compression of still images and video sequences. The most effective application of these methods for compressing naturalistic and medical images.
Claims (23)
- отображают значение модуля ошибки каждого из пикселей всего изображения в двоичную последовательность унарного кода;
- полученный набор двоичных последовательностей представляют в виде набора двоичных уровней, сформированных из двоичных значений, чьи порядковые позиции в коде совпадают с номером соответствующего двоичного уровня;
- на каждом двоичном уровне производят контекстное моделирование для значений модулей ошибок предсказания каждого пикселя, используя значения соседних модулей ошибок предсказания на данном и предыдущем двоичном уровне унарного кода;
- производят контекстное моделирование для значений знаков ошибки для каждого пикселя изображения, используя значения знаков ошибки предсказания соседних пикселей;
- и затем сформированные с помощью контекстного моделирования, выполняемого для значений модулей и знаков ошибок предсказания, двоичные потоки обрабатывают путем сжатия двоичным арифметическим кодером.1. An image compression method, characterized in that initially, for each of the pixels of the input image, a prediction error value is determined, a pair of values is formed: a prediction error modulus value and a prediction error sign value;
- display the value of the error modulus of each of the pixels of the entire image in a binary sequence of a unary code;
- the resulting set of binary sequences is represented as a set of binary levels formed from binary values whose ordinal positions in the code coincide with the number of the corresponding binary level;
- contextual modeling is performed at each binary level for the values of the prediction error modules of each pixel, using the values of neighboring prediction error modules at the given and previous binary level of the unary code;
- make contextual modeling for the values of the error signs for each image pixel, using the values of the error signs of the prediction of neighboring pixels;
- and then generated using context modeling performed for the values of the modules and the signs of the prediction errors, the binary streams are processed by compression with a binary arithmetic encoder.
- отображают значение модуля ошибки каждого из пикселей всего изображения в двоичную последовательность унарного кода;
- полученный набор двоичных последовательностей представляют в виде набора двоичных уровней, сформированных из двоичных значений, чьи порядковые позиции в коде совпадают с номером соответствующего двоичного уровня;
- производят контекстное моделирование для значений модулей ошибок предсказания каждого пикселя с учетом значений соседних пикселей на данном и предыдущем двоичном уровне унарного кода для двоичных уровней, сформированных из двоичных значений унарного кода, чьи порядковые позиции в коде не превышают заданный порог;
- на остальных двоичных уровнях необработанные значения преобразуют в двоичный код и производят контекстное моделирование для значений получаемого двоичного кода;
- производят контекстное моделирование для значений знаков ошибки предсказания для каждого пикселя изображения с учетом значений знаков ошибки предсказания соседних пикселей;
- и затем сформированные с помощью контекстного моделирования, выполняемого для значений модулей и знаков ошибок предсказания, двоичные потоки обрабатывают путем сжатия двоичным арифметическим кодером.11. An image compression method, characterized in that initially, for each of the pixels of the input image, a prediction error value is determined, a pair of values is formed: a prediction error modulus value and a prediction error sign value;
- display the value of the error modulus of each of the pixels of the entire image in a binary sequence of a unary code;
- the resulting set of binary sequences is represented as a set of binary levels formed from binary values whose ordinal positions in the code coincide with the number of the corresponding binary level;
- make contextual modeling for the values of the error prediction modules of each pixel, taking into account the values of neighboring pixels at a given and previous binary level of a unary code for binary levels formed from binary values of a unary code whose ordinal positions in the code do not exceed a predetermined threshold;
- on the remaining binary levels, the raw values are converted into binary code and contextual modeling is performed for the values of the resulting binary code;
- make contextual modeling for the values of the signs of the prediction error for each image pixel, taking into account the values of the signs of the prediction error of neighboring pixels;
- and then generated using context modeling performed for the values of the modules and the signs of the prediction errors, the binary streams are processed by compression with a binary arithmetic encoder.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| RU2014148851/08A RU2579966C1 (en) | 2014-12-04 | 2014-12-04 | Method of image compressing (versions) |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| RU2014148851/08A RU2579966C1 (en) | 2014-12-04 | 2014-12-04 | Method of image compressing (versions) |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| RU2579966C1 true RU2579966C1 (en) | 2016-04-10 |
Family
ID=55793824
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| RU2014148851/08A RU2579966C1 (en) | 2014-12-04 | 2014-12-04 | Method of image compressing (versions) |
Country Status (1)
| Country | Link |
|---|---|
| RU (1) | RU2579966C1 (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5903676A (en) * | 1994-11-10 | 1999-05-11 | The Chinese University Of Hong Kong | Context-based, adaptive, lossless image codec |
| RU2350041C2 (en) * | 2003-07-18 | 2009-03-20 | Сони Корпорейшн | Device and method of image information coding, and also device and method of image information decoding |
| RU2514787C1 (en) * | 2007-06-28 | 2014-05-10 | Мицубиси Электрик Корпорейшн | Image encoding device and image decoding device |
-
2014
- 2014-12-04 RU RU2014148851/08A patent/RU2579966C1/en active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5903676A (en) * | 1994-11-10 | 1999-05-11 | The Chinese University Of Hong Kong | Context-based, adaptive, lossless image codec |
| RU2350041C2 (en) * | 2003-07-18 | 2009-03-20 | Сони Корпорейшн | Device and method of image information coding, and also device and method of image information decoding |
| RU2514787C1 (en) * | 2007-06-28 | 2014-05-10 | Мицубиси Электрик Корпорейшн | Image encoding device and image decoding device |
Non-Patent Citations (1)
| Title |
|---|
| статья W.B. PENNEBAKER et al. "An overview of the basic principles of the Q-coder adaptive binary arithmetic coder", опубликовано 06.11.1988, 10 стр. [он-лайн][найдено 2015-09-15], найдено в Интернет: <URL: http://web.stanford.edu/class/ee398a/handouts/papers/Pennebaker%20-%20Adaptive%20Bin%20Arithmetic%20Coder.pdf>. статья MATTEW V. MAHONEY "The PAQ1 data compression program", опубликовано 20.01.2002, 14 стр. [он-лайн][найдено 2015-09-15], найдено в Интернет: <URL: http://compression.ru/download/articles/cm/mahoney_2002_paq1.pdf>. * |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8977066B2 (en) | Image compression using sub-resolution images | |
| CN101232621B (en) | Effectively compress and recover method, medium and the equipment of edge position images | |
| WO2015120818A1 (en) | Picture coding and decoding methods and devices | |
| CN113421312B (en) | Coloring method and device for black-and-white video, storage medium and terminal | |
| CN101822063A (en) | Method and apparatuses for encoding and decoding image | |
| CN106464852B (en) | Video processing system with high dynamic range sensor mechanism and method of operation thereof | |
| CN103369317A (en) | Method and apparatus for image data compression | |
| WO2010050152A1 (en) | Pixel prediction value generation procedure automatic generation method, image encoding method, image decoding method, devices using these methods, programs for these methods, and recording medium on which these programs are recorded | |
| CN114598883B (en) | Point cloud attribute prediction method, encoder, decoder and storage medium | |
| US20240114185A1 (en) | Video coding for machines (vcm) encoder and decoder for combined lossless and lossy encoding | |
| CN112887722A (en) | Lossless image compression method | |
| CN102271251B (en) | Lossless Image Compression Method | |
| CN110024383B (en) | Image compression technology | |
| CN107845358B (en) | Display driving device and display driving method | |
| US8712170B2 (en) | Image-processing method and program, and image-processing apparatus | |
| CN104038765A (en) | Rapid and efficient damage-free image compression method oriented to hardware achievement | |
| JP2015023506A (en) | Image encoding apparatus and image decoding apparatus | |
| RU2579966C1 (en) | Method of image compressing (versions) | |
| JP4521835B2 (en) | Image processing device | |
| US9615111B2 (en) | Complexity-adaptive compression of color images using binary arithmetic coding | |
| KR101289881B1 (en) | Apparatus and method for lossless image compression | |
| JP4328363B2 (en) | Image compression apparatus, image compression program, and image expansion apparatus | |
| JP2001128182A (en) | Image encoding method and computer-readable recording medium storing image encoding program | |
| JP6581469B2 (en) | Image encoding apparatus, control method therefor, program, and storage medium | |
| KR20190091180A (en) | Image processing device |