[go: up one dir, main page]

CN106791843A - A kind of Lossless Image Compression Algorithm system and method - Google Patents

A kind of Lossless Image Compression Algorithm system and method Download PDF

Info

Publication number
CN106791843A
CN106791843A CN201611181053.3A CN201611181053A CN106791843A CN 106791843 A CN106791843 A CN 106791843A CN 201611181053 A CN201611181053 A CN 201611181053A CN 106791843 A CN106791843 A CN 106791843A
Authority
CN
China
Prior art keywords
image
row
frame
pixel rows
output
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201611181053.3A
Other languages
Chinese (zh)
Other versions
CN106791843B (en
Inventor
秦琦
王加庆
吴南健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Semiconductors of CAS
Original Assignee
Institute of Semiconductors of CAS
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 Institute of Semiconductors of CAS filed Critical Institute of Semiconductors of CAS
Priority to CN201611181053.3A priority Critical patent/CN106791843B/en
Publication of CN106791843A publication Critical patent/CN106791843A/en
Application granted granted Critical
Publication of CN106791843B publication Critical patent/CN106791843B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/423Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/436Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation using parallelised computational arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

本发明提供了一种图像无损压缩系统,包括状态寄存单元、数据分配器、S‑O‑F插入器、求差编码单元和码流合成器,状态寄存单元,用于寄存并输出接收的至少一帧图像的各序号;数据分配器,用于接收所述图像,并根据所述序号选通S‑O‑F插入器或求差编码单元;S‑O‑F插入器和求差编码单元,输出处理后的数据至码流合成器,码流合成器根据所述序号,整合并依次选通输出压缩后的图像信息。本发明还提供了一种图像无损压缩方法,有效降低图像中的空间冗余度,易于图像对齐和快速检索,且算法简单并行度高,易于算法的硬件移植,可以实现极高数据带宽下的实时图像压缩,而图像信息无损失。

The invention provides a lossless image compression system, comprising a state register unit, a data distributor, an S-O-F inserter, a difference encoding unit and a code stream synthesizer, and a state register unit for registering and outputting at least Each serial number of a frame of images; a data distributor for receiving said images, and gating an S-O-F inserter or a difference coding unit according to said serial number; an S-O-F inserter and a difference coding unit , output the processed data to the code stream synthesizer, and the code stream synthesizer integrates and sequentially selects and outputs the compressed image information according to the serial number. The invention also provides a lossless image compression method, which effectively reduces the spatial redundancy in the image, facilitates image alignment and fast retrieval, and has a simple algorithm with a high degree of parallelism, and is easy to transplant to the hardware of the algorithm. Real-time image compression without loss of image information.

Description

一种图像无损压缩系统及方法An image lossless compression system and method

技术领域technical field

本发明涉及图像信息处理技术领域,尤其涉及一种图像无损压缩系统及方法。The invention relates to the technical field of image information processing, in particular to an image lossless compression system and method.

背景技术Background technique

图像传感器目前已广泛应用于科学研究,工业生产,医疗卫生,国防军事等各个领域。随着图像分辨率及图像帧率的不断提升,人类得以观察到更加细微的物体特征,或者更为短暂的物理现象,从而极大的丰富了人类的观测手段,提高了人类的认知水平。Image sensors have been widely used in various fields such as scientific research, industrial production, medical and health care, national defense and military affairs. With the continuous improvement of image resolution and image frame rate, human beings can observe more subtle object features or more short-term physical phenomena, which greatly enriches human observation methods and improves human cognition.

然而随着图像性能参数的迅速提升,同时也带来了图像数据量和数据传输带宽成倍增长的巨大挑战。海量的图像数据和超高数据传输带宽,为后续的图像传输、存储及处理都带来了一系列技术难题。However, with the rapid improvement of image performance parameters, it also brings a huge challenge that the amount of image data and data transmission bandwidth increase exponentially. Massive image data and ultra-high data transmission bandwidth have brought a series of technical difficulties for subsequent image transmission, storage and processing.

目前针对此类高分辨率,高帧率下的超高带宽图像数据流(尤其是对超过10Gbps量级的图像数据流),进行实时的、且无信息损失的压缩相对困难。受高帧率、高数据带宽,以及处理能力限制,现有高速图像采集系统中,多为直接存储原始图像数据而未做任何处理。所以图像数据中存在大量的冗余数据,实际上浪费了存储容量,占用了额外传输带宽,也大幅提高了成像系统的实现成本。At present, it is relatively difficult to perform real-time compression without information loss for such high-resolution, ultra-high-bandwidth image data streams at high frame rates (especially for image data streams exceeding 10 Gbps). Limited by high frame rate, high data bandwidth, and processing capability, most of the existing high-speed image acquisition systems store raw image data directly without any processing. Therefore, there is a large amount of redundant data in the image data, which actually wastes storage capacity, occupies additional transmission bandwidth, and greatly increases the implementation cost of the imaging system.

发明内容Contents of the invention

(一)要解决的技术问题(1) Technical problems to be solved

本发明的目的在于提供一种图像无损压缩系统及方法,以解决上述的至少一项技术问题。The object of the present invention is to provide an image lossless compression system and method to solve at least one of the above technical problems.

(二)技术方案(2) Technical solutions

本发明提供了一种图像无损压缩系统,包括:The invention provides an image lossless compression system, comprising:

状态寄存单元,用于寄存并输出接收的至少一帧图像的各序号;A status register unit, configured to register and output each sequence number of at least one frame of images received;

数据分配器,用于接收所述图像,并根据所述序号选通S-O-F插入器或求差编码单元;a data distributor, configured to receive the image, and select an S-O-F inserter or a difference encoding unit according to the serial number;

S-O-F插入器(数据帧头插入器),用于根据所述序号,输出第一帧图像的暗像素行和有效像素行第一行、及除第一帧图像外的其余各帧图像的有效像素行第一行;以及将除第一帧图像外的其余各帧图像的暗像素行替换成对齐码,并输出对齐码;S-O-F inserter (data frame header inserter), used for outputting the dark pixel row and the effective pixel row first row of the first frame image according to the sequence number, and the effective pixels of the remaining frames except the first frame image row the first row; and replace the dark pixel rows of each frame image except the first frame image with the alignment code, and output the alignment code;

求差编码单元,用于求取每一帧图像除第一行有效像素行外的其余有效像素行前后行的残差;对所述残差编码,并输出编码后的标示值与溢出值;The difference-seeking coding unit is used to calculate the residuals of the remaining effective pixel rows before and after the remaining effective pixel rows of each frame of image except the first effective pixel row; encode the residual, and output the encoded marked value and overflow value;

码流合成器,用于根据所述序号,整合并依次选通输出压缩后的图像信息。The code stream synthesizer is used for integrating and sequentially gating and outputting the compressed image information according to the sequence number.

优选地,所述压缩后的图像信息为第一帧图像的暗像素行、有效像素行第一行、以及其余有效像素行的标示值和溢出值;除第一帧图像外的其余各帧图像的有效像素行第一行、暗像素行的对齐码以及其余有效像素行的标示值和溢出值。Preferably, the compressed image information is the marked value and overflow value of the dark pixel row of the first frame image, the first row of effective pixel row, and the rest of the effective pixel row; The alignment code of the first row of effective pixel rows, the dark pixel row, and the label value and overflow value of the remaining effective pixel rows.

优选地,所述状态寄存单元包括:Preferably, the state register unit includes:

循环计数器,用于寄存图像数据的像素序号;The loop counter is used to register the pixel serial number of the image data;

循环计数器,用于寄存图像数据的行序号;The loop counter is used to store the row number of the image data;

递增计数器,用于寄存图像数据的帧序号。Incremental counter, used to register the frame number of image data.

优选地,所述求差编码单元包括:Preferably, the difference-seeking coding unit includes:

数据双缓存单元,用于接收、存储并输出所述图像;a data double buffering unit for receiving, storing and outputting the image;

帧间差值运算器,用于求取并输出所述残差及溢出值;An inter-frame difference calculator, used to obtain and output the residual and overflow value;

差值编码器,用于对所述残差编码,输出编码后的标示值;A difference encoder, configured to encode the residual, and output an encoded marked value;

溢出值数据缓存单元,用于存储并输出所述溢出值。The overflow value data buffer unit is used for storing and outputting the overflow value.

基于同一发明构思,本发明还提供了一种图像无损压缩方法,包括:Based on the same inventive concept, the present invention also provides a method for image lossless compression, including:

S1、依次接收至少一帧图像,寄存并输出所述图像的各序号,即像素序号、行序号和帧序号;S1. Receive at least one frame of image in sequence, register and output each serial number of the image, that is, pixel serial number, row serial number and frame serial number;

S2、处理第一帧图像:输出第一帧图像暗像素行及有效像素第一行;计算并编码其余有效像素行计算各行残差,得到并输出编码后的标示值和溢出值;S2. Processing the first frame of image: output the dark pixel row of the first frame image and the first row of effective pixels; calculate and encode the remaining effective pixel rows to calculate the residuals of each row, obtain and output the coded marked value and overflow value;

S3、处理除第一帧图像外的其余各帧图像:得到并输出其余各帧图像暗像素行的对齐码;输出有效像素第一行;计算并编码其余有效像素行计算前后行的残差,得到并输出编码后的标示值和溢出值;S3. Process the remaining frames of images except the first frame of images: obtain and output the alignment codes of the dark pixel rows of the remaining frames of images; output the first row of effective pixels; calculate and encode the residuals of the remaining effective pixel rows before and after the calculation, Obtain and output encoded marked value and overflow value;

S4、根据所述序号,整合并依次选通输出压缩后的图像信息。S4. According to the sequence number, integrate and sequentially select and output the compressed image information.

优选地,所述压缩后的图像信息为第一帧图像的暗像素行、有效像素行第一行、以及其余有效像素行的标示值和溢出值;除第一帧图像外的其余各帧图像的暗像素行的对齐码、有效像素行第一行、以及其余有效像素行的标示值和溢出值。Preferably, the compressed image information is the marked value and overflow value of the dark pixel row of the first frame image, the first row of effective pixel row, and the rest of the effective pixel row; The alignment code of the dark pixel row, the first row of the valid pixel row, and the label value and overflow value of the remaining valid pixel rows.

优选地,所述对齐码满足公式:Preferably, the alignment code satisfies the formula:

or

其中,gray(p,l,f)为图像的灰度函数,p为图像的像素序号,1为行序号,f为帧序号,M为图像宽度,N为图像高度,R为图像像素的量化位宽,ldark为图像的暗像素行行高,%为取余运算符。Among them, gray(p, l, f) is the grayscale function of the image, p is the pixel number of the image, 1 is the row number, f is the frame number, M is the image width, N is the image height, and R is the quantization of the image pixel Bit width, l dark is the dark pixel row height of the image, % is the remainder operator.

优选地,所述残差δ(p,l,f)满足公式:Preferably, the residual δ(p, l, f) satisfies the formula:

δ(p,l,f)=gray(p,l,f)-gray(p,l-1,f)δ(p,l,f)=gray(p,l,f)-gray(p,l-1,f)

(1≤p≤M,Ldark+1<l≤N,f≥1)。(1≤p≤M, L dark +1<l≤N, f≥1).

优选地,所述标示值B(p,l,f)满足公式:Preferably, the indicated value B(p, l, f) satisfies the formula:

其中,TH为阈值,TH=2k-1(0<K<R);binKδ(p,l,f)为残差的K比特有符号自然二进制码,binKTH为TH的K比特有符号自然二进制码,binK-(TH+1)为-(TH+1)的K比特有符号自然二进制码。Among them, TH is the threshold value, TH=2 k -1 (0<K<R); binK δ(p, l, f) is the K-bit signed natural binary code of the residual, and binK TH is the K-bit signed natural binary code of TH Natural binary code, binK -(TH+1) is a K-bit signed natural binary code of -(TH+1).

优选地,所述溢出值O(p,l,f)满足公式:Preferably, the overflow value O(p, l, f) satisfies the formula:

其中,binRδ(p,l,m)为残差的R比特有符号自然二进制码。Among them, binR δ(p, l, m) is the R-bit signed natural binary code of the residual.

(三)有益效果(3) Beneficial effects

1、本发明的图像无损压缩方法简单高效,硬件实现时延时较低,可以实现较高的处理主频;此外并行度高,可以处理多帧图像,以及多个图像区块,因此非常利于算法的硬件移植,可实现极高数据带宽下的实时压缩;1. The image lossless compression method of the present invention is simple and efficient, the hardware implementation time delay is low, and a higher processing frequency can be realized; in addition, the parallelism is high, and multiple frames of images and multiple image blocks can be processed, so it is very beneficial The hardware transplantation of the algorithm can realize real-time compression under extremely high data bandwidth;

2、本发明的图像无损压缩系统包括S-O-F插入器,既能保留暗像素数据,又能设置图像的帧头对齐码,利于压缩数据后处理或图像重建阶段的快速图像检索、定位和对齐;2. The image lossless compression system of the present invention includes an S-O-F inserter, which can not only retain dark pixel data, but also set the frame header alignment code of the image, which is beneficial to rapid image retrieval, positioning and alignment in the post-processing of compressed data or image reconstruction stage;

3、本发明适用于高帧率图像数据流和缓变图像数据流的压缩;3. The present invention is applicable to the compression of high frame rate image data streams and slowly changing image data streams;

4、本发明算法可以实现极高数据带宽下的实时图像压缩,且图像信息无损失。4. The algorithm of the present invention can realize real-time image compression under extremely high data bandwidth without loss of image information.

附图说明Description of drawings

图1是本发明实施例的结构示意图;Fig. 1 is the structural representation of the embodiment of the present invention;

图2为本发明实施例的步骤示意图;Fig. 2 is a schematic diagram of steps of an embodiment of the present invention;

图3为本发明实施例的具体实现流程图;Fig. 3 is the specific implementation flowchart of the embodiment of the present invention;

图4为本发明实施例的输出数据流格式的示意图;4 is a schematic diagram of an output data stream format according to an embodiment of the present invention;

图5为本发明实施例的测试图像示意图。FIG. 5 is a schematic diagram of a test image of an embodiment of the present invention.

具体实施方式detailed description

本发明实施例的一个方面,提供了一种图像无损压缩系统,包括:An aspect of the embodiments of the present invention provides an image lossless compression system, including:

状态寄存单元,用于寄存并输出接收的至少一帧图像的各序号;A status register unit, configured to register and output each sequence number of at least one frame of images received;

具体地,所述状态寄存单元包括:循环计数器,用于寄存图像数据的像素序号;循环计数器,用于寄存图像数据的行序号;递增计数器,用于寄存图像数据的帧序号。Specifically, the state registering unit includes: a loop counter, used for registering the pixel serial number of the image data; a loop counter, used for registering the row serial number of the image data; an increment counter, used for registering the frame serial number of the image data.

数据分配器,用于接收所述图像,并根据所述序号选通S-O-F插入器或求差编码单元;a data distributor, configured to receive the image, and select an S-O-F inserter or a difference encoding unit according to the serial number;

S-O-F插入器,用于根据所述序号,输出第一帧图像的暗像素行和有效像素行第一行、及除第一帧图像外的其余各帧图像的有效像素行第一行;以及将除第一帧图像外的其余各帧图像的暗像素行替换成对齐码,并输出对齐码;The S-O-F inserter is used to output the first row of dark pixels and the first row of effective pixel rows of the first frame image, and the first row of effective pixel rows of each frame image except the first frame image according to the sequence number; and Replace the dark pixel rows of each frame image except the first frame image with the alignment code, and output the alignment code;

求差编码单元,用于求取每一帧图像除第一行有效像素行外的其余有效像素行前后行的残差;对所述残差编码,并输出编码后的标示值与溢出值;The difference-seeking coding unit is used to calculate the residuals of the remaining effective pixel rows before and after the remaining effective pixel rows of each frame of image except the first effective pixel row; encode the residual, and output the encoded marked value and overflow value;

具体地,所述求差编码单元包括:数据双缓存单元,用于接收、存储并输出所述图像;帧间差值运算器,用于求取并输出所述残差及溢出值;差值编码器,用于对所述残差编码,输出编码后的标示值;溢出值数据缓存单元,用于存储并输出所述溢出值。Specifically, the difference encoding unit includes: a data double buffer unit for receiving, storing and outputting the image; an inter-frame difference calculator for calculating and outputting the residual and overflow value; the difference An encoder, configured to encode the residual, and output an encoded flag value; an overflow value data buffer unit, configured to store and output the overflow value.

码流合成器,用于根据所述序号,整合并依次选通输出压缩后的图像信息:第一帧图像的暗像素行、有效像素行第一行、以及其余有效像素行的标示值和溢出值;除第一帧图像外的其余各帧图像的有效像素行第一行、暗像素行的对齐码以及其余有效像素行的标示值和溢出值。A code stream synthesizer, used to integrate and sequentially strobe and output compressed image information according to the sequence number: the dark pixel row of the first frame image, the first row of valid pixel rows, and the marked values and overflow of the remaining valid pixel rows Value; the alignment codes of the first line of effective pixel rows and dark pixel rows of the other frame images except the first frame image, and the label value and overflow value of the remaining effective pixel rows.

本发明实施例的另一方面,还提供了一种图像无损压缩方法,包括:Another aspect of the embodiments of the present invention also provides a method for image lossless compression, including:

S1、依次接收至少一帧图像,寄存并输出所述图像的各序号,即像素序号、行序号和帧序号;S1. Receive at least one frame of image in sequence, register and output each serial number of the image, that is, pixel serial number, row serial number and frame serial number;

S2、处理第一帧图像:输出第一帧图像暗像素行及有效像素第一行;计算并编码其余有效像素行计算各行残差,得到并输出编码后的标示值和溢出值;S2. Processing the first frame of image: output the dark pixel row of the first frame image and the first row of effective pixels; calculate and encode the remaining effective pixel rows to calculate the residuals of each row, obtain and output the coded marked value and overflow value;

S3、处理除第一帧图像外的其余各帧图像:得到并输出其余各帧图像暗像素行的对齐码;S3. Process the other frames of images except the first frame of images: obtain and output the alignment codes of the dark pixel rows of the remaining frames of images;

输出有效像素第一行;计算并编码其余有效像素行计算前后行的残差,得到并输出编码后的标示值和溢出值;Output the first row of effective pixels; calculate and encode the residuals of the remaining effective pixel rows before and after the calculation, and obtain and output the coded marked value and overflow value;

所述对齐码满足公式:The alignment code satisfies the formula:

or

其中,gray(p,l,f)为图像的灰度函数,p为图像的像素序号,l为行序号,f为帧序号,M为图像宽度,N为图像高度,R为图像像素的量化位宽,ldark为图像的暗像素行行高,%为取余运算符。Among them, gray(p, l, f) is the grayscale function of the image, p is the pixel number of the image, l is the line number, f is the frame number, M is the image width, N is the image height, and R is the quantization of the image pixel Bit width, l dark is the dark pixel row height of the image, % is the remainder operator.

S4、根据所述序号,整合并依次选通输出压缩后的图像信息:第一帧图像的暗像素行、有效像素行第一行、以及其余有效像素行的标示值和溢出值;除第一帧图像外的其余各帧图像的有效像素行第一行、暗像素行的对齐码以及其余有效像素行的标示值和溢出值。S4. According to the serial number, integrate and sequentially strobe and output the compressed image information: the dark pixel row of the first frame image, the first row of effective pixel rows, and the marked values and overflow values of the remaining effective pixel rows; except for the first Alignment codes of the first row of effective pixel rows and dark pixel rows of the remaining frames of images outside the frame image, and the label values and overflow values of the remaining effective pixel rows.

其中,所述残差δ(p,l,f)满足公式:Wherein, the residual δ (p, l, f) satisfies the formula:

δ(p,l,f)=gray(p,l,f)-gray(p,l-1,f)δ(p,l,f)=gray(p,l,f)-gray(p,l-1,f)

(1≤p≤M,Ldark+1<l≤N,f≥1)。(1≤p≤M, L dark +1<l≤N, f≥1).

所述标示值B(p,l,f)满足公式:The indicated value B(p, l, f) satisfies the formula:

其中,TH为阈值,TH=2k-1(0<K<R);binKδ(p,l,f)为残差的K比特有符号自然二进制码,binKTH为TH的K比特有符号自然二进制码,binK-(TH+1)为-(TH+1)的K比特有符号自然二进制码。Among them, TH is the threshold value, TH=2 k -1 (0<K<R); binK δ(p, l, f) is the K-bit signed natural binary code of the residual, and binK TH is the K-bit signed natural binary code of TH Natural binary code, binK -(TH+1) is a K-bit signed natural binary code of -(TH+1).

所述溢出值O(p,l,f)满足公式:The overflow value O(p, l, f) satisfies the formula:

其中,binRδ(p,l,m)为残差的R比特有符号自然二进制码。Among them, binR δ(p, l, m) is the R-bit signed natural binary code of the residual.

为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明作进一步的详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

图1为本发明实施的结构示意图,如图1所示,图像无损压缩系统包括:状态寄存单元、数据分配器、S-O-F插入器、求差编码单元和码流合成器。所述状态寄存器包括P循环计数器,用于寄存图像数据的像素序号p;L循环计数器,用于寄存图像数据的行序号1;和F递增计数器,用于寄存图像数据的帧序号f;状态寄存单元接收至少一帧图像,寄存并输出所述图像的各序号,即像素序号p、行序号1和帧序号f,至数据分配器、S-O-F插入器和码流合成器。Fig. 1 is a schematic structural diagram of the implementation of the present invention. As shown in Fig. 1, the image lossless compression system includes: a state register unit, a data distributor, an S-O-F inserter, a difference encoding unit and a code stream synthesizer. Described state register comprises P loop counter, is used for registering the pixel serial number p of image data; L loop counter, is used for registering row serial number 1 of image data; With F incremental counter, is used for registering the frame serial number f of image data; The unit receives at least one frame of image, registers and outputs the serial numbers of the image, namely pixel serial number p, row serial number 1 and frame serial number f, to the data distributor, S-O-F inserter and code stream synthesizer.

所述数据分配器接收所述图像以及状态寄存单元输出的p、l、f序号选通S-O-F插入器或求差编码单元。S-O-F插入器接收所述p、l、f序号,输出第一帧图像的暗像素行和有效像素行第一行、及除第一帧图像外的其余各帧图像的有效像素行第一行;以及将除第一帧图像外的其余各帧图像的暗像素行替换成对齐码,并输出对齐码G(p,l,f)。所述求差编码单元,包含:数据双缓存单元、帧间差值运算器、差值编码器和溢出值数据缓存单元。数据双缓存单元接收、存储并输出所述图像;帧间差值运算器,求取并输出所述残差δ(p,l,f)及溢出值O(p,l,f);差值编码器,对所述残差编码,输出编码后的标示值B(p,l,f);溢出值数据缓存单元,存储并输出所述溢出值至码流合成器。The data distributor receives the image and the p, l, f sequence numbers output by the status register unit to select the S-O-F inserter or the difference encoding unit. The S-O-F inserter receives the p, l, f serial numbers, outputs the first row of dark pixel rows and the first row of effective pixel rows of the first frame image, and the first row of effective pixel rows of all other frame images except the first frame image; And replace the dark pixel rows of the other frame images except the first frame image with the alignment code, and output the alignment code G(p, l, f). The difference encoding unit includes: a data double buffer unit, an inter-frame difference calculator, a difference encoder and an overflow value data buffer unit. The data double buffering unit receives, stores and outputs the image; the inter-frame difference operator calculates and outputs the residual δ (p, l, f) and overflow value O (p, l, f); difference The encoder encodes the residual, and outputs the encoded label value B(p, l, f); the overflow value data buffer unit stores and outputs the overflow value to the code stream synthesizer.

码流合成器接收S-O-F插入器、差值编码器和溢出值数据缓存器输出的信息,根据所述序号,输出压缩后的图像信息:第一帧图像的暗像素行、有效像素行第一行、以及其余有效像素行的标示值和溢出值;除第一帧图像外的其余各帧图像的暗像素行的对齐码、有效像素行第一行、以及其余有效像素行的标示值和溢出值。The code stream synthesizer receives the information output by the S-O-F inserter, the difference encoder and the overflow value data buffer, and outputs the compressed image information according to the sequence number: the dark pixel row of the first frame image, the first row of the effective pixel row , and the marked value and overflow value of the other valid pixel rows; the alignment code of the dark pixel row of the other frame images except the first frame image, the first row of the effective pixel row, and the marked value and overflow value of the remaining valid pixel rows .

图2为本发明实施例的步骤示意图,如图2所示,图像无损压缩方法包括:Fig. 2 is a schematic diagram of the steps of an embodiment of the present invention, as shown in Fig. 2, the image lossless compression method includes:

S1、依次接收至少一帧图像,寄存并输出所述图像的各序号,即像素序号、行序号和帧序号;S1. Receive at least one frame of image in sequence, register and output each serial number of the image, that is, pixel serial number, row serial number and frame serial number;

S2、处理第一帧图像:输出第一帧图像暗像素行及有效像素第一行;计算并编码其余有效像素行计算各行残差,得到并输出编码后的标示值和溢出值;S2. Processing the first frame of image: output the dark pixel row of the first frame image and the first row of effective pixels; calculate and encode the remaining effective pixel rows to calculate the residuals of each row, obtain and output the coded marked value and overflow value;

所述残差满足公式:The residual satisfies the formula:

δ(p,l,f)=gray(p,l,f)-gray(p,l-1,f)δ(p,l,f)=gray(p,l,f)-gray(p,l-1,f)

(1≤p≤M,Ldark+1<l≤N,f≥1)(1≤p≤M, L dark +1<l≤N, f≥1)

所述标示值B(p,l,f)满足公式:The indicated value B(p, l, f) satisfies the formula:

其中,TH为阈值,TH=2k-1(0<K<R);binKδ(p,l,f)为残差的K比特有符号自然二进制码,binKTH为TH的K比特有符号自然二进制码,binK-(TH+1)为-(TH+1)的K比特有符号自然二进制码。Among them, TH is the threshold value, TH=2 k -1 (0<K<R); binK δ(p, l, f) is the K-bit signed natural binary code of the residual, and binK TH is the K-bit signed natural binary code of TH Natural binary code, binK -(TH+1) is a K-bit signed natural binary code of -(TH+1).

所述溢出值O(p,l,f)满足公式:The overflow value O(p, l, f) satisfies the formula:

其中,binRδ(p,l,m)为残差的R比特有符号自然二进制码。Among them, binR δ(p, l, m) is the R-bit signed natural binary code of the residual.

S3、处理除第一帧图像外的其余各帧图像:得到并输出其余各帧图像暗像素行的对齐码;输出有效像素第一行;计算并编码其余有效像素行计算前后行的残差,得到并输出编码后的标示值和溢出值;S3. Process the remaining frames of images except the first frame of images: obtain and output the alignment codes of the dark pixel rows of the remaining frames of images; output the first row of effective pixels; calculate and encode the residuals of the remaining effective pixel rows before and after the calculation, Obtain and output encoded marked value and overflow value;

所述对齐码满足公式:The alignment code satisfies the formula:

or

其中,gray(p,l,f)为图像的灰度函数,p为图像的像素序号,l为行序号,f为帧序号,M为图像宽度,N为图像高度,R为图像像素的量化位宽,ldark为图像的暗像素行行高,%为取余运算符。Among them, gray(p, l, f) is the grayscale function of the image, p is the pixel number of the image, l is the line number, f is the frame number, M is the image width, N is the image height, and R is the quantization of the image pixel Bit width, l dark is the dark pixel row height of the image, % is the remainder operator.

S4、根据所述序号,整合并依次选通输出压缩后的图像信息:第一帧图像的暗像素行、有效像素行第一行、以及其余有效像素行的标示值和溢出值;除第一帧图像外的其余各帧图像的暗像素行的对齐码、有效像素行第一行、以及其余有效像素行的标示值和溢出值。S4. According to the serial number, integrate and sequentially strobe and output the compressed image information: the dark pixel row of the first frame image, the first row of effective pixel rows, and the marked values and overflow values of the remaining effective pixel rows; except for the first The alignment codes of the dark pixel rows, the first row of effective pixel rows, and the indication values and overflow values of the remaining effective pixel rows of the remaining frames of images outside the frame image.

图3为本发明实施例的具体实现流程图,如图3所示,图像无损压缩系统开始处理至少一帧图像,先根据递增计数器中寄存的帧序号f判断当前图像是否为第一帧图像,再将循环计数器L中寄存的行序号1与暗像素行ldark比较,判断当前行为暗像素行还是有效像素行的各个行。当前图像为第一帧图像时:若当前行为暗像素行或者有效像素行的第一行,则直接输出原始数据至码流合成器;若当前行为除第一行有效像素行之外的其余有效像素行,则进行该行和前一行残差的计算,再对残差和阈值TH判断,输出对应的标示值和溢出值。若当前图像为除第一帧之外的其他帧图像时:若当前行为暗像素行,则计算并输出对齐码;若当前行为有效像素行第一行,则不作处理直接输出原始数据;若当前行为除第一行有效像素行之外的其余有效像素行,则计算该行和前一行的残差,再对残差和阈值TH判断,输出对应的标示值和溢出值至码流合成器。最后,码流合成器整合接收的数据,输出压缩后的图像信息。Fig. 3 is the specific implementation flowchart of the embodiment of the present invention, as shown in Fig. 3, the image lossless compression system starts to process at least one frame image, first judges whether the current image is the first frame image according to the frame number f registered in the increment counter, Then compare the row number 1 stored in the loop counter L with the dark pixel row l dark to determine whether the current row is a dark pixel row or each row of a valid pixel row. When the current image is the first frame image: if the current line is the first line of the dark pixel line or the effective pixel line, then directly output the original data to the code stream synthesizer; if the current line is valid except for the first line of effective pixel line For a pixel row, calculate the residual of this row and the previous row, then judge the residual and the threshold TH, and output the corresponding marked value and overflow value. If the current image is a frame image other than the first frame: if the current row is a dark pixel row, calculate and output the alignment code; if the current row is the first row of a valid pixel row, output the original data directly without processing; if the current row For the remaining effective pixel rows except the first effective pixel row, calculate the residual of this row and the previous row, then judge the residual and threshold TH, and output the corresponding marked value and overflow value to the code stream synthesizer. Finally, the code stream synthesizer integrates the received data and outputs compressed image information.

图4为本发明实施例的输出数据流格式的示意图,如图4所示,所述图像无损压缩系统输出的压缩后的信息为:第一帧图像的暗像素行、有效像素行第一行、以及其余有效像素行的标示值和溢出值;除第一帧图像外的其余各帧图像的暗像素行的对齐码、有效像素行第一行、以及其余有效像素行的标示值和溢出值。Fig. 4 is a schematic diagram of the output data stream format of the embodiment of the present invention. As shown in Fig. 4, the compressed information output by the image lossless compression system is: the dark pixel row of the first frame image, the first row of effective pixel row , and the marked value and overflow value of the other valid pixel rows; the alignment code of the dark pixel row of the other frame images except the first frame image, the first row of the effective pixel row, and the marked value and overflow value of the remaining valid pixel rows .

图5为本发明实施例的测试图像示意图,如图5所示,原始图像为2560(H)×2162(V)×16bits=88555520bits,暗像素行2行,经过本发明的压缩方法处理,设定阈值为127,即K=8,其理论极限压缩比为1.997,实际压缩后图像大小为44883689bits,图像压缩比约为1.973。Fig. 5 is the test image schematic diagram of the embodiment of the present invention, as shown in Fig. 5, original image is 2560 (H) * 2162 (V) * 16bits=88555520bits, dark pixel line 2 lines, through compression method processing of the present invention, set The fixed threshold is 127, that is, K=8, the theoretical limit compression ratio is 1.997, the actual compressed image size is 44883689bits, and the image compression ratio is about 1.973.

以上所述的具体实施例,对本发明的目的、技术方案和有益效果进行了进一步详细说明,应理解的是,以上所述仅为本发明的具体实施例而已,并不用于限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above have further described the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention, and are not intended to limit the present invention. Within the spirit and principles of the present invention, any modifications, equivalent replacements, improvements, etc., shall be included in the protection scope of the present invention.

Claims (10)

1.一种图像无损压缩系统,其特征在于,包括:1. A lossless image compression system, comprising: 状态寄存单元,用于寄存并输出接收的至少一帧图像的各序号;A status register unit, configured to register and output each sequence number of at least one frame of images received; 数据分配器,用于接收所述图像,并根据所述序号选通S-O-F插入器或求差编码单元;a data distributor, configured to receive the image, and select an S-O-F inserter or a difference encoding unit according to the serial number; S-O-F插入器,用于根据所述序号,输出第一帧图像的暗像素行和有效像素行第一行、及除第一帧图像外的其余各帧图像的有效像素行第一行;以及将除第一帧图像外的其余各帧图像的暗像素行替换成对齐码,并输出对齐码;The S-O-F inserter is used to output the first row of dark pixels and the first row of effective pixel rows of the first frame image, and the first row of effective pixel rows of each frame image except the first frame image according to the sequence number; and Replace the dark pixel rows of each frame image except the first frame image with the alignment code, and output the alignment code; 求差编码单元,用于求取每一帧图像除第一行有效像素行外的其余有效像素行前后行的残差;对所述残差编码,并输出编码后的标示值与溢出值;The difference-seeking coding unit is used to calculate the residuals of the remaining effective pixel rows before and after the remaining effective pixel rows of each frame of image except the first effective pixel row; encode the residual, and output the encoded marked value and overflow value; 码流合成器,用于根据所述序号,整合并依次选通输出压缩后的图像信息。The code stream synthesizer is used for integrating and sequentially gating and outputting the compressed image information according to the sequence number. 2.根据权利要求1所述的系统,其特征在于,所述压缩后的图像信息为第一帧图像的暗像素行、有效像素行第一行、以及其余有效像素行的标示值和溢出值;除第一帧图像外的其余各帧图像的有效像素行第一行、暗像素行的对齐码以及其余有效像素行的标示值和溢出值。2. The system according to claim 1, wherein the compressed image information is the marked value and overflow value of the dark pixel row of the first frame image, the first row of effective pixel rows, and the remaining effective pixel rows ; Alignment codes of the first line of effective pixel rows and dark pixel rows of the other frames of images except the first frame of image, and the marked values and overflow values of the remaining effective pixel rows. 3.根据权利要求1所述的系统,其特征在于,所述状态寄存单元包括:3. The system according to claim 1, wherein the state register unit comprises: 循环计数器,用于寄存图像数据的像素序号;The loop counter is used to register the pixel serial number of the image data; 循环计数器,用于寄存图像数据的行序号;The loop counter is used to store the row number of the image data; 递增计数器,用于寄存图像数据的帧序号。Incremental counter, used to register the frame number of image data. 4.根据权利要求1所述的系统,其特征在于,所述求差编码单元包括:4. The system according to claim 1, wherein the difference encoding unit comprises: 数据双缓存单元,用于接收、存储并输出所述图像;a data double buffering unit for receiving, storing and outputting the image; 帧间差值运算器,用于求取并输出所述残差及溢出值;An inter-frame difference calculator, used to obtain and output the residual and overflow value; 差值编码器,用于对所述残差编码,输出编码后的标示值;A difference encoder, configured to encode the residual, and output an encoded marked value; 溢出值数据缓存单元,用于存储并输出所述溢出值。The overflow value data buffer unit is used for storing and outputting the overflow value. 5.一种图像无损压缩方法,其特征在于,包括:5. A method for image lossless compression, comprising: S1、依次接收至少一帧图像,寄存并输出所述图像的各序号,即像素序号、行序号和帧序号;S1. Receive at least one frame of image in sequence, register and output each serial number of the image, that is, pixel serial number, row serial number and frame serial number; S2、处理第一帧图像:输出第一帧图像暗像素行及有效像素第一行;计算并编码其余有效像素行计算各行残差,得到并输出编码后的标示值和溢出值;S2. Processing the first frame of image: output the dark pixel row of the first frame image and the first row of effective pixels; calculate and encode the remaining effective pixel rows to calculate the residuals of each row, obtain and output the coded marked value and overflow value; S3、处理除第一帧图像外的其余各帧图像:得到并输出其余各帧图像暗像素行的对齐码;输出有效像素第一行;计算并编码其余有效像素行计算前后行的残差,得到并输出编码后的标示值和溢出值;S3. Process the remaining frames of images except the first frame of images: obtain and output the alignment codes of the dark pixel rows of the remaining frames of images; output the first row of effective pixels; calculate and encode the residuals of the remaining effective pixel rows before and after the calculation, Obtain and output encoded marked value and overflow value; S4、根据所述序号,整合并依次选通输出压缩后的图像信息。S4. According to the sequence number, integrate and sequentially select and output the compressed image information. 6.根据权利要求5所述的方法,其特征在于,所述压缩后的图像信息为第一帧图像的暗像素行、有效像素行第一行、以及其余有效像素行的标示值和溢出值;除第一帧图像外的其余各帧图像的暗像素行的对齐码、有效像素行第一行、以及其余有效像素行的标示值和溢出值。6. The method according to claim 5, wherein the compressed image information is the marked value and overflow value of the dark pixel row of the first frame image, the first row of effective pixel rows, and the remaining effective pixel rows ; The alignment codes of the dark pixel rows, the first row of valid pixel rows, and the marked values and overflow values of the remaining valid pixel rows except the first frame of image. 7.根据权利要求5所述的方法,其特征在于,所述对齐码满足公式:7. The method according to claim 5, wherein the alignment code satisfies the formula: or 其中,gray(p,l,f)为图像的灰度函数,p为图像的像素序号,l为行序号,f为帧序号,M为图像宽度,N为图像高度,R为图像像素的量化位宽,ldark为图像的暗像素行行高,%为取余运算符。Among them, gray(p, l, f) is the grayscale function of the image, p is the pixel number of the image, l is the line number, f is the frame number, M is the image width, N is the image height, and R is the quantization of the image pixel Bit width, l dark is the dark pixel row height of the image, % is the remainder operator. 8.根据权利要求7所述的方法,其特征在于,所述残差δ(p,l,f)满足公式:8. method according to claim 7, is characterized in that, described residual δ (p, l, f) satisfies formula: δ(p,l,f)=gray(p,l,f)-gray(p,l-1,f)δ(p,l,f)=gray(p,l,f)-gray(p,l-1,f) (1≤p≤M,Ldark+1<l≤N,f≥1)。(1≤p≤M, L dark +1<l≤N, f≥1). 9.根据权利要求8所述的方法,其特征在于,所述标示值B(p,l,f)满足公式:9. method according to claim 8, is characterized in that, described mark value B (p, l, f) satisfies formula: 其中,TH为阈值,TH=2k-1(0<K<R);binKδ(p,l,f)为残差的K比特有符号自然二进制码,binKTH为TH的K比特有符号自然二进制码,binK-(TH+1)为-(TH+1)的K比特有符号自然二进制码。Among them, TH is the threshold value, TH=2 k -1 (0<K<R); binK δ(p, l, f) is the K-bit signed natural binary code of the residual, and binK TH is the K-bit signed natural binary code of TH Natural binary code, binK -(TH+1) is a K-bit signed natural binary code of -(TH+1). 10.根据权利要求9所述的方法,其特征在于,所述溢出值O(p,l,f)满足公式:10. method according to claim 9, is characterized in that, described overflow value O (p, l, f) satisfies formula: 其中,binRδ(p,l,m)为残差的R比特有符号自然二进制码。Among them, binR δ(p, l, m) is the R-bit signed natural binary code of the residual.
CN201611181053.3A 2016-12-19 2016-12-19 A kind of Lossless Image Compression Algorithm system and method Active CN106791843B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611181053.3A CN106791843B (en) 2016-12-19 2016-12-19 A kind of Lossless Image Compression Algorithm system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611181053.3A CN106791843B (en) 2016-12-19 2016-12-19 A kind of Lossless Image Compression Algorithm system and method

Publications (2)

Publication Number Publication Date
CN106791843A true CN106791843A (en) 2017-05-31
CN106791843B CN106791843B (en) 2019-09-24

Family

ID=58890990

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611181053.3A Active CN106791843B (en) 2016-12-19 2016-12-19 A kind of Lossless Image Compression Algorithm system and method

Country Status (1)

Country Link
CN (1) CN106791843B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107659815A (en) * 2017-09-13 2018-02-02 中国科学院半导体研究所 Image decompression method and the device for performing it
CN107680030A (en) * 2017-09-21 2018-02-09 中国科学院半导体研究所 A kind of image processor and processing method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5095374A (en) * 1989-10-10 1992-03-10 Unisys Corporation Method and apparatus for lossless compression and decompression of image data
CN1965586A (en) * 2004-06-07 2007-05-16 学校法人大洋学园 Method of lossless encoding and decoding, and apparatus thereof
CN103024383A (en) * 2012-12-14 2013-04-03 北京工业大学 Intra-frame lossless compression coding method based on HEVC (high efficiency video coding) frame
CN104202607A (en) * 2014-08-26 2014-12-10 西安电子科技大学 Image lossless compression method and electronic device
CN104349171A (en) * 2013-07-31 2015-02-11 上海通途半导体科技有限公司 Image compression encoding and decoding devices without visual loss, and encoding and decoding methods

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5095374A (en) * 1989-10-10 1992-03-10 Unisys Corporation Method and apparatus for lossless compression and decompression of image data
CN1965586A (en) * 2004-06-07 2007-05-16 学校法人大洋学园 Method of lossless encoding and decoding, and apparatus thereof
CN103024383A (en) * 2012-12-14 2013-04-03 北京工业大学 Intra-frame lossless compression coding method based on HEVC (high efficiency video coding) frame
CN104349171A (en) * 2013-07-31 2015-02-11 上海通途半导体科技有限公司 Image compression encoding and decoding devices without visual loss, and encoding and decoding methods
CN104202607A (en) * 2014-08-26 2014-12-10 西安电子科技大学 Image lossless compression method and electronic device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107659815A (en) * 2017-09-13 2018-02-02 中国科学院半导体研究所 Image decompression method and the device for performing it
CN107659815B (en) * 2017-09-13 2022-06-03 中国科学院半导体研究所 Image decompression method and device for executing the same
CN107680030A (en) * 2017-09-21 2018-02-09 中国科学院半导体研究所 A kind of image processor and processing method
CN107680030B (en) * 2017-09-21 2020-10-30 中国科学院半导体研究所 An image processor and processing method

Also Published As

Publication number Publication date
CN106791843B (en) 2019-09-24

Similar Documents

Publication Publication Date Title
CN101335897B (en) Image compression/decoding method and system
CN109889846B (en) Method and device for compressing and decompressing Demura table data and coding and decoding system
US8902994B1 (en) Deblocking filtering
CN106170921A (en) Relate to source code and the decoding method and device of the data of sign compression
TW200913718A (en) Operating method and device of coded block flag parameter
CN102244784B (en) Method for compressing and displaying picture including transparent information
US20130251257A1 (en) Image encoding device and image encoding method
CN108419086B (en) An Image Compression Method Based on Huffman Coding
CN115866287B (en) Efficient data transmission method for intelligent campus management platform
Maleki et al. Blockcnn: A deep network for artifact removal and image compression
CN107105208A (en) A kind of lossless coding and coding/decoding method of Bayer images
CN101494788B (en) Method and apparatus for compressing and decompressing video image
CN108846873A (en) A kind of Medical Image Lossless Compression method based on gray probability
CN105554502A (en) Distributed compressed sensing video encoding and decoding method based on foreground-background separation
CN106791843B (en) A kind of Lossless Image Compression Algorithm system and method
CN106791844B (en) An image lossless compression device and method
CN105874718A (en) Decoding device, imaging system, decoding method, encoding/ decoding method, and decoding program
CN108830909A (en) Promote the image preprocessing system and method for period texture image compression ratio
CN107659815B (en) Image decompression method and device for executing the same
CN107592541B (en) An image decompression method and system
CN113347424B (en) Video coding data storage method and device and readable storage medium
CN106791275B (en) A method and system for image event detection and marking
US8363968B2 (en) Image coding method for facilitating run length coding and image encoding device thereof
CN109862363A (en) The second-compressed method and its compressibility of video
CN111263155B (en) Compression method and system for equal-resolution CR image

Legal Events

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