CN108429916B - Image coding method and device - Google Patents

Image coding method and device Download PDF

Info

Publication number
CN108429916B
CN108429916B CN201810160152.6A CN201810160152A CN108429916B CN 108429916 B CN108429916 B CN 108429916B CN 201810160152 A CN201810160152 A CN 201810160152A CN 108429916 B CN108429916 B CN 108429916B
Authority
CN
China
Prior art keywords
bit
bit plane
plane
wavelet
stream
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.)
Active
Application number
CN201810160152.6A
Other languages
Chinese (zh)
Other versions
CN108429916A (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.)
Xian Wanxiang Electronics Technology Co Ltd
Original Assignee
Xian Wanxiang Electronics Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xian Wanxiang Electronics Technology Co Ltd filed Critical Xian Wanxiang Electronics Technology Co Ltd
Priority to CN201810160152.6A priority Critical patent/CN108429916B/en
Publication of CN108429916A publication Critical patent/CN108429916A/en
Application granted granted Critical
Publication of CN108429916B publication Critical patent/CN108429916B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/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/184Methods 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 bits, e.g. of the compressed video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/63Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using sub-band based transform, e.g. wavelets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Landscapes

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

Abstract

The invention provides an image coding method and device, relates to the technical field of image processing, and can solve the problems that in the image coding process, the pixel value and the threshold value are repeatedly compared, the image coding time and the operation amount are increased, and coding redundancy is caused. The specific technical scheme is as follows: acquiring an image frame to be processed; performing wavelet decomposition on an image frame to be processed to obtain an initial bit stream; determining a bit plane of which the bit is less than or equal to a preset bit plane in the initial bit stream as a first bit plane; determining a bit plane with bits larger than a preset bit plane in the initial bit stream as a second bit plane; directly outputting a bit value to data in a first bit plane to obtain a first bit stream to be coded; processing data in a second bit plane according to an SPIHT algorithm to obtain a second bit stream to be coded; and entropy coding the first bit stream to be coded and the second bit stream to be coded. The invention is used for image coding.

Description

Image coding method and device
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image encoding method and apparatus.
Background
The image compression technology is particularly important in the storage and transmission processes of image data, the efficient image compression can relieve the problems of limited image storage space, limited network bandwidth and the like, wherein a multilevel Tree set Splitting (SPIHT) algorithm based on wavelet transformation is widely applied to the field of image compression due to the characteristics of high compression efficiency and low calculation complexity, progressive transmission and the like. However, when encoding an image using the SPIHT algorithm, the SPIHT algorithm needs to repeatedly compare a pixel value with a threshold value, which increases the time and the amount of computation for encoding the image, and causes encoding redundancy.
Disclosure of Invention
The embodiment of the disclosure provides an image coding method and an image coding device, which can solve the problem that coding redundancy is caused by repeatedly comparing a pixel value with a threshold value in an image coding process and increasing image coding time and computation amount. The technical scheme is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided an image encoding method, the method including:
acquiring an image frame to be processed, wherein the image frame to be processed comprises at least one macro block;
performing wavelet decomposition on each macro block in an image frame to be processed to obtain a wavelet coefficient of at least one wavelet node and form an initial bit stream;
determining a bit plane of which the bit is less than or equal to a preset bit plane in the initial bit stream as a first bit plane; determining a bit plane with bits larger than a preset bit plane in the initial bit stream as a second bit plane;
directly outputting a bit value to data in a first bit plane to obtain a first bit stream to be coded;
processing data in a second bit plane according to a multi-level tree set splitting SPIHT algorithm to obtain a second bit stream to be coded;
and entropy coding the first bit stream to be coded and the second bit stream to be coded.
For the bit plane with the bit position larger than the preset bit plane, the data of the high-order bit position is more important and has larger influence on the image quality, the SPIHT algorithm is adopted for processing to ensure the image quality, and for the bit plane with the bit position smaller than or equal to the preset bit plane, the data is not very important because of the low-order bit position, the bit value is directly output, the coding complexity is reduced, and the coding time is reduced.
In one embodiment, the method further comprises:
determining a maximum bit according to a maximum wavelet coefficient in wavelet coefficients of at least one wavelet node;
and determining a preset bit plane according to the maximum bit, wherein the preset bit plane is less than or equal to the maximum bit.
The maximum bit positions of data in different image frames are different, and the preset bit plane is determined according to the maximum bit positions, so that the method can be flexibly suitable for the coding process of various image frames.
In one embodiment, determining the maximum bit based on a largest wavelet coefficient of the wavelet coefficients of the at least one wavelet node comprises:
according to the formula k-floor (log2(max { | C)r,c| j)) compute the maximum bit; wherein, Cr,cIs the wavelet coefficient and k is the maximum bit.
In one embodiment, processing the data in the second bit plane according to the multi-level tree set splitting SPIHT algorithm to obtain a second bit stream to be encoded includes:
determining a judgment threshold value of each bit plane in the second bit plane;
determining a bit to be coded output by each bit in the second bit plane according to the absolute value of each numerical value in the second bit plane and the judgment threshold of each bit plane;
and forming a second bit stream to be coded according to the bits to be coded output by each bit in the second bit plane.
And for the data contained in the second bit plane, outputting the bits to be coded according to the judgment threshold value of each bit plane and the absolute value of each numerical value, further compressing the data volume of the second bit stream to be coded, and reducing the coding complexity.
In one embodiment, the second bitstream to be encoded comprises wavelet coefficient bits; the wavelet coefficient sign bit, the descendant set null identifier, the grandchild set four-number joint null identifier and at least one of the grandchild set null identifier are also included.
According to a second aspect of the embodiments of the present disclosure, there is provided an image encoding device including: the device comprises an acquisition module, a wavelet decomposition module, a bit plane classification module, a first data processing module, a second data processing module and a coding module;
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring an image frame to be processed, and the image frame to be processed comprises at least one macro block;
the wavelet decomposition module is used for performing wavelet decomposition on each macro block in the image frame to be processed to obtain a wavelet coefficient of at least one wavelet node and form an initial bit stream;
a bit plane classification module, configured to determine a bit plane in which bits in the initial bit stream are less than or equal to a preset bit plane as a first bit plane; determining a bit plane with bits larger than a preset bit plane in the initial bit stream as a second bit plane;
the first data processing module is used for directly outputting a bit value to the data in the first bit plane to obtain a first bit stream to be coded;
the second data processing module is used for processing the data in the second bit plane according to a multi-level tree set splitting SPIHT algorithm to obtain a second bit stream to be coded;
and the coding module is used for entropy coding the first bit stream to be coded and the second bit stream to be coded.
In one embodiment, the image encoding apparatus further includes: a maximum bit module and a preset bit plane module;
a maximum bit module for determining a maximum bit according to a maximum wavelet coefficient of wavelet coefficients of at least one wavelet node;
and the preset bit plane module is used for determining a preset bit plane according to the maximum bit, and the preset bit plane is smaller than or equal to the maximum bit.
In one embodiment, the maximum bit module includes a computation submodule;
a calculation submodule for calculating the value of floor (log2(max { | C) according to the formula k { |r,c| j)) compute the maximum bit; wherein, Cr,cIs the wavelet coefficient and k is the maximum bit.
In one embodiment, the second data processing module includes a threshold submodule, an output submodule, and a bitstream submodule;
the threshold submodule is used for determining a judgment threshold of each bit plane in the second bit plane;
the output submodule is used for determining the bit to be coded output by each bit in the second bit plane according to the absolute value of each numerical value in the second bit plane and the judgment threshold value of each bit plane;
and the bit stream submodule is used for forming a second bit stream to be coded according to the bits to be coded output by each bit in the second bit plane.
In one embodiment, the second bitstream to be encoded comprises wavelet coefficient bits; the wavelet coefficient sign bit, the descendant set null identifier, the grandchild set four-number joint null identifier and at least one of the grandchild set null identifier are also included.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart of an image encoding method provided by an embodiment of the present disclosure;
FIG. 2 is a schematic diagram illustrating the effect of a three-level haar wavelet transform provided by an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a bit plane effect provided by an embodiment of the present disclosure;
fig. 4 is a block diagram of an image encoding apparatus according to another embodiment of the present disclosure;
fig. 5 is a block diagram of an image encoding apparatus provided in an embodiment of the present disclosure;
fig. 6 is a structural diagram of an image encoding device according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
An embodiment of the present disclosure provides an image encoding method, as shown in fig. 1, the image encoding method including the steps of:
101. and acquiring an image frame to be processed.
The image frame to be processed comprises at least one macro block.
102. And performing wavelet decomposition on each macro block in the image frame to be processed to obtain a wavelet coefficient of at least one wavelet node and form an initial bit stream.
It should be noted that wavelet decomposition, i.e. wavelet transform, is a relatively mature technology, and the disclosure does not limit this, and here, the haar wavelet transform is used as an example to illustrate the process of wavelet decomposition as follows:
for example, in the case of the haar wavelet transform, a macroblock has a1、A2、A3、A4Four pixels with pixel values of [9, 7, 3, 5 ] respectively](ii) a Firstly, A is mixed1And A2Is averaged with the pixel value of (A)3And A4Is averaged to obtain a value of [8, 4 ]]Calculating A1And A2Is calculated as a, is half of the difference in pixel values of3And A4Obtain a value of 1, -1 for half the difference of the pixel values](ii) a Then, to [8, 4 ]]Two values in the set of averages are averaged and half the difference is calculated to obtain a value [6 ]]And [2 ]](ii) a Then [6, 2, 1, -1]I.e. the result of the haar wavelet transform, contains an average value 6]And three detail coefficients [2, 1, -1%]. Similarly, if the number of the pixels is 16, the result of the haar wavelet transform is 4 average values and 12 detail coefficients, and the haar wavelet transform is performed on the 4 average values to obtain a result, namely a result of the second-level haar wavelet transform. In step 102, N layers of wavelet decomposition may be performed on each macroblock, where N is an integer greater than or equal to 1, which is not limited by this disclosure.
As shown in fig. 2, fig. 2 is a schematic diagram illustrating the effect of three-level haar wavelet transform, where 64 pixel values in fig. 2 are subjected to first-level haar wavelet transform to obtain 16 average values, are subjected to second-level haar wavelet transform to obtain 4 average values, and are subjected to third-level haar wavelet transform to obtain 1 average value, and there are relations of root, child and grandchild among these groups of average values, where an average value obtained by the third-level haar wavelet transform is a root node, an average value obtained by the second-level haar wavelet transform is a child node, and an average value obtained by the first-level haar wavelet transform is a grandchild node, and as shown in fig. 2, the position occupied by one value is a wavelet node, and data stored in one wavelet node is a wavelet coefficient.
For example, the wavelet coefficients may be sorted in the order of a root node set, a child node set, and a grandchild node set, and sorted in the order of the zigzag patterns (LL-L H-H L-HH) shown in each set, which is merely illustrative and does not represent that the present disclosure is limited thereto.
103. Determining a bit plane of which the bit is less than or equal to a preset bit plane in the initial bit stream as a first bit plane; and determining a bit plane with bits larger than a preset bit plane in the initial bit stream as a second bit plane.
Here, an exemplary bit plane is explained, as shown in fig. 3, an initial bit stream is obtained in step 102, the initial bit stream includes at least one pixel value, for example, a value range of one pixel value is 0 to 255, and then one pixel value needs to be represented by 8 bits, in fig. 3, the pixel values are arranged longitudinally, each row of bits has 8 bits in total to represent one pixel value, and when dividing is performed according to a longitudinal column, the pixel values can be divided into 8 bit planes according to the bits. Of course, this is merely an example and does not represent a limitation of the present disclosure.
The preset bit-plane may be determined from the largest bit-plane, e.g., in one embodiment, the method further comprises:
determining a maximum bit according to a maximum wavelet coefficient in wavelet coefficients of at least one wavelet node; and determining a preset bit plane according to the maximum bit, wherein the preset bit plane is less than or equal to the maximum bit.
The maximum bit positions of data in different image frames are different, and the preset bit plane is determined according to the maximum bit positions, so that the method can be flexibly suitable for the coding process of various image frames.
In one embodiment, determining the maximum bit based on a largest wavelet coefficient of the wavelet coefficients of the at least one wavelet node comprises:
according to the formula k-floor (log2(max { | C)r,c| j)) compute the maximum bit; wherein, Cr,cIs the wavelet coefficient, (r, c) represents the coordinate of the wavelet node, and k is the maximum bit.
104. And directly outputting the data in the first bit plane to a bit value to obtain a first bit stream to be coded.
For bit planes with bits less than or equal to the predetermined bit plane, since the bits are the lower bits, the data is not very important, and the bit value is directly output.
105. And processing the data in the second bit plane according to a multi-level tree set splitting SPIHT algorithm to obtain a second bit stream to be coded.
In one embodiment, the second bitstream to be encoded comprises wavelet coefficient bits; the wavelet coefficient sign bit, the descendant set null identifier, the grandchild set four-number joint null identifier and at least one of the grandchild set null identifier are also included.
In one embodiment, processing the data in the second bit plane according to the multi-level tree set splitting SPIHT algorithm to obtain a second bit stream to be encoded includes:
determining a judgment threshold value of each bit plane in the second bit plane; determining a bit to be coded output by each bit in the second bit plane according to the absolute value of each numerical value in the second bit plane and the judgment threshold of each bit plane; and forming a second bit stream to be coded according to the bits to be coded output by each bit in the second bit plane.
And for the data contained in the second bit plane, outputting the bits to be coded according to the judgment threshold value of each bit plane and the absolute value of each numerical value, further compressing the data volume of the second bit stream to be coded, and reducing the coding complexity.
Illustratively, a specific example is set forth herein to illustrate how the data of the second bit plane is processed using the SPIHT algorithm:
firstly, determining a judgment threshold value of each bit plane, and if the maximum bit plane is k, the judgment threshold value of the maximum bit plane is 2kThe bit plane one bit lower than the maximum bit plane is k-1, and the judgment threshold is 2k-1And so on. For example, the maximum bit plane is 8, the preset bit plane is 5, and the judgment thresholds of bit planes 8-5 are 256, 128, 64, and 32 in sequence.
The absolute value of each value is then compared to the decision threshold for each bit-plane. The value is obtained by wavelet decomposition of the original pixel value. Taking the target value and the ith bit plane as an example, the judgment threshold of the bit plane is T.
Firstly, the judgment mode of the root node is as follows:
1, if the absolute value of the target value is more than or equal to 2T, outputting a bit to be coded as the value of the ith bit of the target value;
2, if the absolute value of the 2T > target value is more than or equal to T, outputting a bit to be coded as a '1' and a sign identification bit, wherein the sign identification bit is '1' when the bit is a positive number, and the sign identification bit is '0' when the bit is a negative number;
and 3, if the absolute value of the target value is less than T, outputting the bit to be coded as '0'.
Secondly, the judgment mode of the child node is as follows:
1, if the absolute value of the target value is more than or equal to 2T, the output bit to be coded is the value of the ith bit of the target value and is stored in the subset code stream 1;
2, if the absolute value of the target value is more than or equal to T, the output bit to be coded is '1' and a sign identification bit and is stored in the subset code stream 2, the sign identification bit is '1' when the value of the ith bit of the target value is a positive number, and the sign identification bit is '0' when the value of the ith bit of the target value is a negative number;
and 3, if the absolute value of the target numerical value is less than T, outputting a bit to be coded as '0' and storing the bit into the subset code stream 2.
If the sub-set code stream 2 is all '0', the sub-set invalid identifier is set to 1, if the sub-set code stream 2 is empty, the sub-set invalid identifier is set to 2, and if the sub-set code stream 2 is not all '0', the sub-set invalid identifier is set to 0.
Thirdly, the judging mode of the grandchild node is as follows:
1, if the absolute value of the target value is more than or equal to 2T, the output bit to be coded is the value of the ith bit of the target value and is stored in a grandchild set code stream 1;
2, if the absolute value of at least one 2T > grandchild node value is greater than or equal to T in the numerical values of the four grandchild nodes corresponding to the child nodes, a code word is not output when the absolute value of a target numerical value is greater than or equal to 2T, a bit to be coded which is output when the absolute value of the 2T > target numerical value is greater than or equal to T is a '1' and a sign identification bit (if the absolute values of the other three grandchild nodes are greater than 2T, only the sign identification bit is output), and a bit to be coded which is output when the absolute value of the target numerical value is less than T is a '0';
if the absolute values of the numerical values of the four grandchild nodes are all larger than or equal to 2T, the code word is not output, otherwise, a code word with a bit to be coded being '0' is output together and stored in the grandchild set code stream 2. If the grandchild set code stream 2 is all '0', the grandchild set invalid identifier is set to 1, if the grandchild set code stream 2 is empty, the grandchild set invalid identifier is set to 2, and if the grandchild set code stream 2 is not all '0', the grandchild set invalid identifier is set to 0.
And finally, forming a second bit stream to be coded according to the bits to be coded output by each bit in the second bit plane.
(1) If the child set invalid identifier and the grandchild set invalid identifier are both 2, the second bit stream to be encoded includes: the method comprises the steps of a root node bit stream to be coded, a sub-set code stream 1 (sub-set important pixel point thinning), and a grandchild set code stream 1 (grandchild set important pixel point thinning).
(2) If the invalid child set identifier and the invalid grandchild set identifier are not both 0 and are not both 2, the second bitstream to be encoded includes: the bit stream to be coded by the root node is + "0" (descendant set null) + child set code stream 1 (descendant set important pixel refinement) + grandchild set code stream 1 (grandchild set important pixel refinement).
(3) If the grandchild set invalid flag is 2 and the child set invalid flag is 0, the second bitstream to be encoded includes: the method comprises the steps that a root node bit stream to be coded + "1" (descendant set is not empty) + a child set code stream 1 (important pixel refinement of the descendant set) + a child set code stream 2 (new effective pixel identification of the descendant set) + an important pixel refinement of the descendant set code stream 1 (important pixel refinement of the descendant set).
(4) If the grandchild set invalid flag is 1 and the child set invalid flag is 0, the second bitstream to be encoded includes: the bit stream to be coded by the root node is + "1" (descendant set is not empty) + the code stream 1 of the descendant set (important pixel points of the descendant set are thinned) + the code stream 2 of the descendant set (new effective pixel identifiers of the descendant set) + the code stream 1 of the descendant set (important pixel points of the descendant set are thinned) + "0" (empty of the descendant set).
(5) Otherwise, if the invalid grandchild set flag is 0, the second bitstream to be encoded includes: the method comprises the steps that a root node bit stream to be coded + "1" (descendant set is not empty) + a descendant set code stream 1 (descendant set important pixel refinement) + a descendant set code stream 2 (descendant set new effective pixel identification) + a descendant set code stream 1 (descendant set important pixel refinement) + "1" (descendant set is not empty) + a descendant set code stream 2 (descendant set new effective pixel identification).
106. And entropy coding the first bit stream to be coded and the second bit stream to be coded.
Here, entropy coding is exemplarily illustrated, and does not represent that the present disclosure is limited thereto. When entropy coding is carried out on a first bit stream to be coded and a second bit stream to be coded, the bits of the first bit stream to be coded comprise wavelet coefficient bits and sign bits, the wavelet coefficient bits are referred according to the importance of a bit plane before a sub-band inner coding point, the importance and the bits of surrounding pixels, and the sign bits are referred according to the sign bits of the surrounding pixels of the sub-band inner coding point; the bits of the second bit stream to be coded include wavelet coefficient bits, sign bits, descendant set null identifiers, descendant set four-number joint null identifiers and descendant set null identifiers. The reference of the bit and the sign bit is consistent with the reference of the first bit stream to be coded during coding, the importance of the root node is used as the reference of the empty identification of the descendant set, the importance of the parent node corresponding to the descendant set is used as the reference of the combined empty identification of the four numbers of the descendant set, and the number of the important pixel points of the descendant set is used as the reference of the empty identification of the descendant set.
The image coding method provided by the embodiment of the disclosure is used for the bit plane with the bit greater than the preset bit plane, the data of the high-order bit is more important, and the influence on the image quality is larger, the SPIHT algorithm is adopted for processing, so that the image quality is ensured, and for the bit plane with the bit less than or equal to the preset bit plane, because the bit is the low-order bit, the data is not very important, the bit value is directly output, the coding complexity is reduced, and the coding time is reduced.
Based on the image encoding method described in the embodiment corresponding to fig. 1, the following is an embodiment of the apparatus of the present disclosure, which can be used to execute the embodiment of the method of the present disclosure.
An embodiment of the present disclosure provides an image encoding apparatus, as shown in fig. 4, the image encoding apparatus 40 including: an acquisition module 401, a wavelet decomposition module 402, a bit plane classification module 403, a first data processing module 404, a second data processing module 405, and an encoding module 406;
an obtaining module 401, configured to obtain an image frame to be processed, where the image frame to be processed includes at least one macroblock;
a wavelet decomposition module 402, configured to perform wavelet decomposition on each macroblock in an image frame to be processed to obtain a wavelet coefficient of at least one wavelet node and form an initial bit stream;
a bit-plane classification module 403, configured to determine, as a first bit plane, a bit plane in the initial bit stream whose bits are less than or equal to a preset bit plane; determining a bit plane with bits larger than a preset bit plane in the initial bit stream as a second bit plane;
a first data processing module 404, configured to directly output a bit value from data in a first bit plane to obtain a first bit stream to be encoded;
a second data processing module 405, configured to process data in a second bit plane according to a multi-level tree set splitting SPIHT algorithm to obtain a second bit stream to be encoded;
and an encoding module 406, configured to entropy encode the first bitstream to be encoded and the second bitstream to be encoded.
In one embodiment, as shown in fig. 5, the image encoding apparatus 40 further includes: a maximum bit block 407 and a preset bit plane block 408;
a maximum bit module 407 configured to determine a maximum bit according to a maximum wavelet coefficient of the wavelet coefficients of at least one wavelet node;
a preset bit plane module 408, configured to determine a preset bit plane according to the maximum bit, where the preset bit plane is smaller than or equal to the maximum bit.
In one embodiment, as shown in fig. 5, the maximum bit module 407 includes a calculation submodule 4071;
a calculation submodule 4071 for calculating the value of floor (log2(max { | C) according to the formula k { | C)r,c| j)) compute the maximum bit; wherein, Cr,cIs the wavelet coefficient and k is the maximum bit.
In one embodiment, as shown in fig. 6, the second data processing module 405 includes a threshold sub-module 4051, an output sub-module 4052, and a bitstream sub-module 4053;
a threshold submodule 4051, configured to determine a judgment threshold of each bit plane in the second bit plane;
the output submodule 4052 is configured to determine, according to the absolute value of each value in the second bit plane and the judgment threshold of each bit plane, a bit to be encoded output by each bit in the second bit plane;
the bitstream submodule 4053 is configured to form a second bitstream to be encoded according to the bits to be encoded output by each bit in the second bit plane.
In one embodiment, the second bitstream to be encoded comprises wavelet coefficient bits; the wavelet coefficient sign bit, the descendant set null identifier, the grandchild set four-number joint null identifier and at least one of the grandchild set null identifier are also included.
The image encoding device provided by the embodiment of the disclosure is used for a bit plane with a bit larger than a preset bit plane, the data of a high bit is more important, the influence on the image quality is larger, the SPIHT algorithm is adopted for processing, the image quality is ensured, and for a bit plane with a bit smaller than or equal to the preset bit plane, the data is not very important because of the low bit, the bit value is directly output, the encoding complexity is reduced, and the encoding time is reduced.
Based on the image encoding method described in the embodiment corresponding to fig. 1, an embodiment of the present disclosure further provides a computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a Read Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The storage medium stores computer instructions for executing the image encoding method described in the embodiment corresponding to fig. 1, which is not described herein again.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (8)

1. An image encoding method, characterized in that the method comprises:
acquiring an image frame to be processed, wherein the image frame to be processed comprises at least one macro block;
performing wavelet decomposition on each macro block in the image frame to be processed to obtain a wavelet coefficient of at least one wavelet node and form an initial bit stream; the initial bit stream comprises at least one pixel value;
determining a bit plane of which the bit is less than or equal to a preset bit plane in the initial bit stream as a first bit plane; determining a bit plane with bits larger than a preset bit plane in the initial bit stream as a second bit plane;
directly outputting a bit value to the data in the first bit plane to obtain a first bit stream to be coded;
processing the data in the second bit plane according to a multi-level tree set splitting SPIHT algorithm to obtain a second bit stream to be coded;
processing the data in the second bit plane according to a multi-level tree set splitting SPIHT algorithm to obtain a second bit stream to be coded, including:
determining a decision threshold for each of the second bit planes;
determining a bit to be coded output by each bit in the second bit plane according to the absolute value of each pixel value in the second bit plane and the judgment threshold T of each bit plane; forming the second bit stream to be coded according to the bits to be coded output by each bit in the second bit plane;
entropy coding the first bit stream to be coded and the second bit stream to be coded.
2. The method of claim 1, further comprising:
determining a maximum bit according to a maximum wavelet coefficient in the wavelet coefficients of the at least one wavelet node;
and determining the preset bit plane according to the maximum bit, wherein the preset bit plane is less than or equal to the maximum bit.
3. The method of claim 2, wherein determining the maximum bit based on a largest wavelet coefficient of the wavelet coefficients of the at least one wavelet node comprises:
according to the formula k-floor (log2(max { | C)r,c| j)) calculate the maximum bit; wherein,Cr,cK is the maximum bit for the wavelet coefficients.
4. The method according to any one of claims 1 to 3,
the second bit stream to be encoded comprises wavelet coefficient bits; the wavelet coefficient sign bit, the descendant set null identifier, the grandchild set four-number joint null identifier and at least one of the grandchild set null identifier are also included.
5. An image encoding device, characterized by comprising: the device comprises an acquisition module, a wavelet decomposition module, a bit plane classification module, a first data processing module, a second data processing module and a coding module;
the acquisition module is used for acquiring an image frame to be processed, and the image frame to be processed comprises at least one macro block;
the wavelet decomposition module is used for performing wavelet decomposition on each macro block in the image frame to be processed to obtain a wavelet coefficient of at least one wavelet node and form an initial bit stream;
the bit plane classification module is configured to determine a bit plane, of which a bit is less than or equal to a preset bit plane, in the initial bit stream as a first bit plane; determining a bit plane with bits larger than a preset bit plane in the initial bit stream as a second bit plane;
the first data processing module is configured to directly output a bit value to the data in the first bit plane to obtain a first bit stream to be encoded;
the second data processing module is configured to process data in the second bit plane according to a multi-level tree set splitting SPIHT algorithm to obtain a second bit stream to be encoded;
the second data processing module comprises a threshold submodule, an output submodule and a bit stream submodule;
the threshold submodule is configured to determine a judgment threshold of each bit plane in the second bit plane;
the output submodule is configured to determine a bit to be encoded output by each bit in the second bit plane according to the absolute value of each pixel value in the second bit plane and the judgment threshold of each bit plane;
the bit stream submodule is configured to form the second bit stream to be encoded according to the bits to be encoded output by each bit in the second bit plane;
the encoding module is configured to entropy encode the first bit stream to be encoded and the second bit stream to be encoded.
6. The apparatus according to claim 5, wherein the image encoding apparatus further comprises: a maximum bit module and a preset bit plane module;
the maximum bit module is configured to determine a maximum bit according to a maximum wavelet coefficient of the wavelet coefficients of the at least one wavelet node;
the preset bit plane module is configured to determine the preset bit plane according to the maximum bit, where the preset bit plane is smaller than or equal to the maximum bit.
7. The apparatus of claim 6, wherein the maximum bit module comprises a computation submodule;
the computation submodule is used for computing the equation k-floor (log2(max { | C)r,c| j)) calculate the maximum bit; wherein, Cr,cK is the maximum bit for the wavelet coefficients.
8. The apparatus according to any one of claims 5 to 7,
the second bit stream to be encoded comprises wavelet coefficient bits; the wavelet coefficient sign bit, the descendant set null identifier, the grandchild set four-number joint null identifier and at least one of the grandchild set null identifier are also included.
CN201810160152.6A 2018-02-26 2018-02-26 Image coding method and device Active CN108429916B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810160152.6A CN108429916B (en) 2018-02-26 2018-02-26 Image coding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810160152.6A CN108429916B (en) 2018-02-26 2018-02-26 Image coding method and device

Publications (2)

Publication Number Publication Date
CN108429916A CN108429916A (en) 2018-08-21
CN108429916B true CN108429916B (en) 2020-07-31

Family

ID=63157242

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810160152.6A Active CN108429916B (en) 2018-02-26 2018-02-26 Image coding method and device

Country Status (1)

Country Link
CN (1) CN108429916B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110417811B (en) * 2019-08-22 2021-08-10 上海兆芯集成电路有限公司 Method and device for bit stream coding compression
CN113542742A (en) * 2021-07-14 2021-10-22 西安万像电子科技有限公司 Image processing method and device

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20020091294A (en) * 2001-05-30 2002-12-06 한국과학기술원 ROI coding method based on the SPIHT
CN1460969A (en) * 2003-06-30 2003-12-10 大唐微电子技术有限公司 Hierarchy tree set partition image coding decoding method based of digital signal processor
CN101980466A (en) * 2010-11-11 2011-02-23 北京航空航天大学 Bit stream transmission method combing SPIHT compression and unequal error protection coding
CN102387356A (en) * 2010-09-06 2012-03-21 索尼公司 Image processing apparatus and method
CN102637302A (en) * 2011-10-24 2012-08-15 北京航空航天大学 Image coding method
CN103108185A (en) * 2013-01-31 2013-05-15 西安电子科技大学 Bit plane encoding hardware structure and method according with consultative committee for space data system (CCSDS) standard
CN103119990A (en) * 2010-07-26 2013-05-22 惠普发展公司,有限责任合伙企业 Method and system for compressing bitplanes based on bit position
CN103327335A (en) * 2013-06-21 2013-09-25 中国科学院空间科学与应用研究中心 FPGA encoding method and system and control method for unmanned aerial vehicle image transmission device
CN103905819A (en) * 2014-04-23 2014-07-02 西安电子科技大学 Coding system based on set partitioning in hierarchical tree and implementation method of coding system
CN104134224A (en) * 2014-07-25 2014-11-05 华南理工大学 Shape-adaptive coding identification photo compression method

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20020091294A (en) * 2001-05-30 2002-12-06 한국과학기술원 ROI coding method based on the SPIHT
CN1460969A (en) * 2003-06-30 2003-12-10 大唐微电子技术有限公司 Hierarchy tree set partition image coding decoding method based of digital signal processor
CN103119990A (en) * 2010-07-26 2013-05-22 惠普发展公司,有限责任合伙企业 Method and system for compressing bitplanes based on bit position
CN102387356A (en) * 2010-09-06 2012-03-21 索尼公司 Image processing apparatus and method
CN101980466A (en) * 2010-11-11 2011-02-23 北京航空航天大学 Bit stream transmission method combing SPIHT compression and unequal error protection coding
CN102637302A (en) * 2011-10-24 2012-08-15 北京航空航天大学 Image coding method
CN103108185A (en) * 2013-01-31 2013-05-15 西安电子科技大学 Bit plane encoding hardware structure and method according with consultative committee for space data system (CCSDS) standard
CN103327335A (en) * 2013-06-21 2013-09-25 中国科学院空间科学与应用研究中心 FPGA encoding method and system and control method for unmanned aerial vehicle image transmission device
CN103905819A (en) * 2014-04-23 2014-07-02 西安电子科技大学 Coding system based on set partitioning in hierarchical tree and implementation method of coding system
CN104134224A (en) * 2014-07-25 2014-11-05 华南理工大学 Shape-adaptive coding identification photo compression method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于 SPIHT 和分类比特编码的无损图像压缩";朱国民,张明锋;《计算机工程与应用》;20071031(第28期);正文第2-5节,图1-2 *

Also Published As

Publication number Publication date
CN108429916A (en) 2018-08-21

Similar Documents

Publication Publication Date Title
JP6239713B2 (en) Moving picture encoding apparatus and moving picture decoding apparatus
CN110710217B (en) Method and apparatus for coding last significant coefficient flag
CN104683811B (en) A kind of Information hiding and extracting method based on the modulation of integer DCT coefficient
Srikanth et al. Compression efficiency for combining different embedded image compression techniques with Huffman encoding
WO2021232251A1 (en) Point cloud encoding/decoding method, encoder, decoder, and storage medium
CN115242475A (en) Big data secure transmission method and system
CN109688407B (en) Reference block selection method and device for coding unit, electronic equipment and storage medium
CN108429916B (en) Image coding method and device
CN111179144B (en) Efficient information hiding method for multi-embedding of multi-system secret information
CN116939226A (en) Low-code-rate image compression-oriented generated residual error repairing method and device
CN111316642A (en) Method and apparatus for signaling image coding and decoding partition information
US20230237705A1 (en) Methods for level partition of point cloud, and decoder
WO2021196038A1 (en) Point cloud encoding and decoding methods and devices
Chen et al. Pixel-level texture segmentation based AV1 video compression
WO2023093377A1 (en) Encoding method, decoding method and electronic device
George et al. A novel approach for image compression using zero tree coding
WO2021184380A1 (en) Point cloud encoding method and decoding method, encoder and decoder, and storage medium
CN111669579B (en) Method, encoding end, decoding end and system for encoding and decoding
Chang et al. A Reversible Data Hiding Method for SMVQ Indices Based on Improved Locally Adaptive Coding.
CN117915107B (en) Image compression system, image compression method, storage medium and chip
CN117440157B (en) Video coding method, device, equipment and storage medium
CN110087073B (en) Multi-threshold string matching data compression method
Saraswat et al. Improved Image Compression by Set Partitioning Block Coding by Modifying SPIHT
CN109302614B (en) Video compression method based on third-order tensor self-coding network
CN116233442A (en) Loop filtering and encoding/decoding method, electronic device, storage medium, and program product

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