WO2022135218A1 - Image encoding method and apparatus - Google Patents

Image encoding method and apparatus Download PDF

Info

Publication number
WO2022135218A1
WO2022135218A1 PCT/CN2021/137657 CN2021137657W WO2022135218A1 WO 2022135218 A1 WO2022135218 A1 WO 2022135218A1 CN 2021137657 W CN2021137657 W CN 2021137657W WO 2022135218 A1 WO2022135218 A1 WO 2022135218A1
Authority
WO
WIPO (PCT)
Prior art keywords
wavelet transform
image
transform coefficients
encoded
frequency band
Prior art date
Application number
PCT/CN2021/137657
Other languages
French (fr)
Chinese (zh)
Inventor
王郝密
Original Assignee
维沃移动通信有限公司
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 维沃移动通信有限公司 filed Critical 维沃移动通信有限公司
Publication of WO2022135218A1 publication Critical patent/WO2022135218A1/en

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/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
    • H04N19/64Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using sub-band based transform, e.g. wavelets characterised by ordering of coefficients or of bits for transmission
    • H04N19/647Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using sub-band based transform, e.g. wavelets characterised by ordering of coefficients or of bits for transmission using significance based coding, e.g. Embedded Zerotrees of Wavelets [EZW] or Set Partitioning in Hierarchical Trees [SPIHT]
    • 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/18Methods 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 a set of transform coefficients
    • 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/182Methods 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 a pixel

Definitions

  • the present application belongs to the field of mobile communications, and in particular relates to an image coding method and device.
  • the image coding algorithm is a technology that exchanges the compression of image data at the expense of acceptable distortion, such as the image compression technology based on Discrete Cosine Transform (DCT), in the Joint Photographic Experts Group, JPEG), but the process of dividing the image to be encoded into blocks is prone to problems such as "block effect”.
  • DCT Discrete Cosine Transform
  • JPEG Joint Photographic Experts Group
  • Wavelet coding has good spatial and frequency localization characteristics, and the coefficient distribution of each subband is similar, which makes it easy to form a zero-tree structure and is suitable for zero-tree coding.
  • the algorithm of embedded zerotree coding for DWT coefficients is the embedded zerotree wavelet (Embedded Zerotree Wavelets, EZW) algorithm.
  • EZW embedded Zerotree Wavelets
  • the encoding end needs to store 8 or more lines of data before it can start to transform and encode.
  • the decoding end after caching multiple lines of data, the decoding can be started.
  • inverse transformation processing the first line of data can only be output after the entire block of data is processed, and additional cache memory (memory) space needs to be consumed in the chip design; and the stored data is encoded in sequence during the encoding process. It takes a long time; therefore, the way of EZW encoding is not conducive to the hardware acceleration of the chip.
  • the purpose of the embodiments of the present application is to provide an image encoding method and apparatus, which can solve the problem in the prior art that the EZW encoding method is not conducive to the hardware acceleration of the chip.
  • an embodiment of the present application provides an image encoding method, the method comprising:
  • the discrete wavelet transform EZW coding is performed on the wavelet transform coefficients.
  • an embodiment of the present application further provides an image encoding apparatus, where the image encoding apparatus includes:
  • a pixel acquisition module for acquiring the first input pixel of the image to be encoded
  • a wavelet transform module configured to perform wavelet transform on the first input pixel to obtain wavelet transform coefficients
  • a segmentation processing module configured to perform sub-band processing on the numerical value of the wavelet transform coefficient
  • the encoding processing module is configured to perform discrete wavelet transform EZW encoding on the wavelet transform coefficients according to the frequency band corresponding to each wavelet transform coefficient.
  • an embodiment of the present application further provides an electronic device, the electronic device includes a memory, a processor, and a program or instruction stored in the memory and executable on the processor, where the processor executes the program or The steps in the image encoding method as described above are implemented when instructed.
  • an embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the above-mentioned image encoding method is implemented. step.
  • an embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run a program or an instruction to implement the above method.
  • the first input pixel of the image to be encoded is obtained, and the consumption of the line buffer (line buffer) of the input data in the raster scanning mode is reduced; the wavelet transform is performed on the first input pixel to obtain the wavelet transform coefficient; Then, the numerical value of the wavelet transform coefficient is processed by frequency bands; finally, according to the frequency band corresponding to each wavelet transform coefficient, the wavelet transform coefficient is subjected to discrete wavelet transform EZW encoding, and the encoding process of different frequency bands is performed independently, there are Conducive to the hardware acceleration of the encoder chip.
  • FIG. 1 shows a flowchart of an image encoding method provided by an embodiment of the present application
  • FIG. 2 shows a flowchart of a first example provided by an embodiment of the present application
  • FIG. 3 shows a flowchart of a second example provided by an embodiment of the present application
  • FIG. 4 shows a flowchart of a third example provided by an embodiment of the present application.
  • FIG. 5 shows a flowchart of a fourth example provided by an embodiment of the present application.
  • FIG. 6 shows a block diagram of an image encoding apparatus provided by an embodiment of the present application.
  • FIG. 7 shows one of the block diagrams of the electronic device provided by the embodiment of the present application.
  • FIG. 8 shows the second block diagram of the electronic device provided by the embodiment of the present application.
  • an embodiment of the present application provides an image encoding method, which is applied to an encoding end.
  • the encoding end may be an electronic device, and the electronic device includes various handheld devices, vehicle-mounted devices, Wearable devices, computing devices, or other processing devices connected to wireless modems, as well as various forms of mobile stations (Mobile Station, MS), terminal devices (Terminal Device), and so on.
  • the method includes steps 101 to 104 .
  • Step 101 Obtain a first input pixel of an image to be encoded.
  • a preset pixel unit may be obtained, and the preset pixel unit may be n*m, that is, the first input pixel is obtained according to the preset number of rows, for example, a preset pixel unit may be obtained.
  • the pixel unit can be the first preset pixel unit: 2*32, or the second preset pixel unit: 1*64; it should be understood that 1 and 2 are the number of rows, and 64 and 32 are the pixels corresponding to each row number.
  • the input pixels are not “blocked” to avoid blocking effects; the "blocking" processing is understandable In order to divide the input pixels into a large number of lines, such as 8*8, that is, the case of 8 lines; or 4*16, that is, the case of 4 lines.
  • the preset pixel unit is the second preset pixel unit, for the image mode of the raster scan format, only one line (32 pixel data) of pixel data needs to be cached; if the preset pixel unit is 1*64, only one line of 1 needs to be cached *64 pixel data, reduce the number of lines of the cached image, save the overhead of local cache, and then save the area of the chip.
  • Step 102 Perform wavelet transform on the first input pixel to obtain wavelet transform coefficients.
  • the wavelet transform (Wavelet Transform, WT) is a transformation analysis method.
  • WT Wavelet Transform
  • the localized analysis of the time (or space) frequency can be performed through the transformation.
  • the first input pixel when the first input pixel is subjected to wavelet transform, it may be implemented by a Haar discrete wavelet transform method to obtain and wavelet transform coefficients;
  • the value can be the grayscale value (or luminance value) of the pixel.
  • Step 103 sub-band processing is performed on the numerical value of the wavelet transform coefficient.
  • the wavelet transform coefficient of the first input pixel is obtained, the wavelet transform coefficient is divided into frequency bands according to the numerical value, for example, the wavelet transform coefficient is sequentially divided into multiple frequency bands according to the numerical value, such as the lowest frequency band, the middle frequency band and the highest frequency band.
  • Step 104 Perform discrete wavelet transform EZW coding on the wavelet transform coefficients according to the frequency band corresponding to each wavelet transform coefficient.
  • EZW encoding is performed separately; for example, the first EZW encoding is performed for the highest frequency band, the second EZW encoding is performed for the middle frequency band; the third EZW encoding is performed for the lowest frequency band, the first EZW encoding, the second EZW encoding and the third EZW encoding EZW encoding is carried out independently, and different encoding rules can be used.
  • the three encoding processes can be processed in parallel, which is beneficial to the hardware acceleration of the encoding end.
  • the first input pixel of the image to be encoded is obtained, wherein the first input pixel is obtained according to the preset number of lines, so as to reduce the consumption of the line buffer of the input data in the raster scanning mode; Wavelet transform is performed on the pixels to obtain wavelet transform coefficients; then the numerical value of the wavelet transform coefficients is subjected to frequency division processing; finally, the wavelet transform coefficients are subjected to discrete wavelet transform EZW coding according to the frequency band corresponding to each of the wavelet transform coefficients , the encoding process of different frequency bands is carried out independently, which is beneficial to the hardware acceleration of the encoding end chip.
  • the embodiments of the present application solve the problem that in the prior art, the EZW encoding method is not conducive to the hardware acceleration of the chip.
  • the acquiring the first input pixels of the image to be encoded includes:
  • the first input pixels of one row of the image to be encoded that are pre-buffered in the electronic device are acquired, and the first input pixels of other rows of the image to be encoded are read and cached.
  • the image to be encoded according to the raster scan is first cached locally, which can be realized by random access memory (Random Access Memory, RAM).
  • RAM Random Access Memory
  • the depth of the RAM is the width of the image to be encoded
  • the bit width of the RAM is the pixel width of the image to be encoded. Data bit width.
  • the acquiring the first input pixel of the image to be encoded includes:
  • the number of lines of the first input pixel is one line, taking the preset pixel unit as the second preset pixel unit (1*64) as an example, when the next line of data (the second input pixel) arrives, directly Read 1*64 input pixels to generate a pixel block, and perform the subsequent process of step 102 to perform wavelet transform on the pixel block; then read and cache a row of the second input pixels of the to-be-encoded image. In this way, the number of cache lines occupied by each cache is one line, which can effectively reduce the line cache.
  • performing wavelet transform on the first input pixel to obtain wavelet transform coefficients includes:
  • the first wavelet transform coefficients are subjected to wavelet transform in the second direction to obtain second wavelet transform coefficients.
  • the first direction may be the vertical direction, and the second direction may be the horizontal direction; taking the first input pixel as the gray value of the image as an example, the wavelet transform process is as follows:
  • the first step referring to the following Table 1, for the gray value Y of 2*32 pixels, perform haar wavelet transform.
  • Y0_0 represents the 1st Y signal in the 1st row
  • ... Y0_31 represents the 32nd Y signal in the 1st row
  • Y1_0 represents the 1st Y signal in the 2nd row
  • ... Y1_31 represents the 32nd Y signal in the 2nd row
  • Summation item: ys0 Y0_0+Y1_0-256; wherein, subtracting 256 from the summation item ys is to return the DC component to 0, so that its value is in the same range as the difference item yd.
  • ys31 Y0_31+Y1_31-256;
  • yd31 Y0_31-Y1_31;
  • ys0 to ys31 and yd0 to yd31 are the first wavelet transform coefficients.
  • the second step is to transform in the horizontal direction.
  • the low frequency coefficient is the sum of all summation term coefficients, as shown in the following formula:
  • the first-order high-frequency coefficients are the first 16 summation term coefficients (ys0 to ys15) minus the last 16 summation term coefficients (ys16 to ys31) to obtain the first coefficient scoef1, as shown in the following formula:
  • the 32 summation term coefficients are divided into two groups before and after, and each group is internally calculated according to the method in (2); after the difference is obtained, each difference is multiplied by ⁇ 2 Obtain the second coefficient scoef2 and the third coefficient scoef3 to normalize the haar wavelet coefficients.
  • the seven-factor scoef7 specifically:
  • Scoef15 (ys28+ys29-ys30-ys31)*2 ⁇ 2
  • scoef0 to scoef31 corresponding to ys and dcoef0 to dcoef31 corresponding to yd are the second wavelet transform coefficients.
  • performing frequency division processing on the numerical value of the wavelet transform coefficient including:
  • the second wavelet transform coefficient is divided into a first frequency band, a second frequency band and a third frequency band from low to high.
  • the first frequency band is the lowest frequency band
  • the second frequency band is the middle frequency band
  • the third frequency band is the highest frequency band.
  • performing discrete wavelet transform EZW coding on the wavelet transform coefficients according to the frequency band corresponding to each of the wavelet transform coefficients including:
  • the wavelet transform coefficients are rearranged according to the numerical values of the second wavelet transform coefficients, and are filled into a rearrangement list; in the rearrangement list, the second wavelet transform coefficients of each frequency band correspond to different target locations.
  • the purpose of rearranging is to move the first frequency band coefficients and the second frequency band coefficients in the wavelet coefficients forward as much as possible, so as to increase the priority of the larger coefficients.
  • the rearrangement process includes placing the second wavelet transform coefficients in an 8*8 square table in the order of detour scanning in the order of coefficients from low frequency to high frequency.
  • the specific rearrangement method is:
  • (2) HL2 includes 4 numbers, namely scoef2, scoef3, dcoef2, and dcoef3;
  • LH2 includes 4 numbers, namely scoef4, scoef5, scoef6, and scoef7;
  • HL2 includes 4 numbers, namely dcoef4, dcoef5, dcoef6, and dcoef7;
  • the third frequency band is the third frequency band.
  • HL1 includes 16 numbers, which are scanned and arranged in Z mode; among them,
  • LH1 includes 16 numbers, and the interior is arranged according to the Z scan; among them,
  • HH1 includes 16 numbers, and the interior is arranged according to the Z scan; among them,
  • performing discrete wavelet transform EZW coding on the wavelet transform coefficients includes:
  • Discrete wavelet transform EZW coding is performed on the second wavelet transform coefficients of different frequency bands respectively.
  • the wavelet transform coefficient is greater than the set threshold, it is divided into four states: positive significance coefficient (POS), negative significance coefficient (NEG), zero tree root (ZTR) and isolated zero point (IZ). .
  • POS positive significance coefficient
  • NAG negative significance coefficient
  • ZTR zero tree root
  • IZ isolated zero point
  • FIG. 2 provides an example of performing EZW encoding on the second wavelet transform coefficients of different frequency bands respectively, which mainly includes steps 201 to 210 .
  • Step 201 take the highest bit plane n; wherein, the highest bit plane and the lowest bit plane are the binary highest bit and the lowest bit of the second wavelet transform coefficient, respectively.
  • Step 202 encoding the first frequency band
  • Step 203 determine whether the target rate R is reached; if yes, go to step 209; if not, go to step 204; the target rate R is the preset encoding rate.
  • Step 204 encoding the second frequency band
  • Step 205 determine whether the target rate R is reached; if yes, go to step 209; if not, go to step 206;
  • Step 206 encoding the third frequency band
  • Step 207 judge whether the target rate R is reached; if yes, go to step 209; if not, go to step 208;
  • Step 209 the encoding ends
  • the bit plane can be represented by 4 bits (range 0-15, which can represent the highest bit plane value of 15).
  • the 15-bit plane is taken.
  • the important node situation ps of the previous plane the zero tree root situation pz of the previous plane, the important node cs of the current bit plane, and the zero tree root situation cz of the current bit plane Perform permutation and combination coding.
  • the symbol of the wavelet coefficient is denoted by s, and its absolute value corresponding to the value in the bit plane n is denoted by m.
  • s symbol of the wavelet coefficient
  • m absolute value corresponding to the value in the bit plane n.
  • cz indicates whether the wavelet coefficient in the current bit plane n is in the state of a zero-tree node, and the judgment condition of the zero-tree node is that all descendant coefficients (excluding itself) of the coefficient are unimportant coefficients;
  • ps represents the state of the important node of the wavelet coefficient in the previous bit plane n+1;
  • pz represents the state of the wavelet coefficient zero tree node in the previous bit plane n+1.
  • the process of performing discrete wavelet transform EZW coding on the second wavelet transform coefficients of the first frequency band mainly includes steps 301 to 314 .
  • Step 301 start from bit plane n to encode the low frequency.
  • Step 303 output ⁇ cz, m ⁇ .
  • m; when ps 0, cs and m are the same, and m is the binary state value of the corresponding coefficient of the corresponding bit plane of the current node.
  • Step 306 output ⁇ s, cs ⁇ ;
  • Step 307 output ⁇ cs ⁇
  • the cz of the current plane is used as the pz of the next plane to participate in the judgment.
  • Step 311, ⁇ ps, pz, cs, cz ⁇ 0000, output without encoding
  • Step 314 end the low-frequency coding of bit plane n.
  • the process of performing discrete wavelet transform EZW coding on the second wavelet transform coefficients of the second frequency band mainly includes steps 401 to 417 .
  • the coding of the second frequency band is processed sequentially from the highest bit plane (the highest bit of the coefficient) to the lowest bit plane (the lowest bit of the coefficient, that is, 0).
  • the number of coefficients to be coded is 15.
  • Step 401 take the first second wavelet transform coefficient
  • step 403 If yes, go to step 403, otherwise go to step 404;
  • Step 403 output without encoding.
  • the parent node has already judged that the children are all non-important nodes, and the encoding is skipped directly.
  • Step 410 output ⁇ s, cs ⁇ ;
  • Step 413 output ⁇ cz, s, cs ⁇ ;
  • Step 414 output ⁇ cz, n ⁇ ;
  • Step 416 determine that the target rate R is reached; if so, execute step 417, otherwise go to the next coefficient and continue to execute steps 401 to 416;
  • Step 417 end encoding
  • the process of performing discrete wavelet transform EZW coding on the second wavelet transform coefficients of the third frequency band mainly includes steps 501 to 511 .
  • Step 501 take the first second wavelet transform coefficient
  • step 503 If yes, go to step 503, otherwise go to step 504;
  • Step 503 output without encoding.
  • Step 505 output m
  • Step 507 output ⁇ s, cs ⁇ ;
  • Step 508 output ⁇ cs ⁇
  • Step 510 determine that the target rate R is reached; if so, execute step 510, otherwise go to the next coefficient and continue to execute steps 501 to 511;
  • Step 511 end encoding
  • the first input pixel of the image to be encoded is obtained to reduce the consumption of the line buffer for the input data in the raster scanning mode; the wavelet transform is performed on the first input pixel to obtain the wavelet transform coefficient; The numerical value of the transform coefficient is processed by frequency band; finally, according to the frequency band corresponding to each wavelet transform coefficient, the wavelet transform coefficient is subjected to discrete wavelet transform EZW encoding, and the encoding process of different frequency bands is carried out independently, which is beneficial to the coding end chip.
  • Hardware Acceleration is performed by frequency band.
  • the execution body may be an image encoding apparatus, or a control module in the image encoding apparatus for executing the image encoding method.
  • an image encoding method performed by an image encoding apparatus is used as an example to describe the image encoding method provided by the embodiments of the present application.
  • the embodiment of the present application further provides an image encoding apparatus 600 , including: a pixel acquisition module 601 , a wavelet transform module 602 , a segmentation processing module 603 and an encoding processing module 604 .
  • the pixel obtaining module 601 is configured to obtain the first input pixel of the image to be encoded.
  • the preset pixel unit may be the first preset pixel unit or the second preset pixel unit; the first preset pixel unit is 2*32, and the second preset pixel unit is 1*64; Encoding is performed once per unit of the first input pixel, and when the input pixel is read, the input pixel is not "blocked" to avoid block effects. If the preset pixel unit is the second preset pixel unit, for the image mode of the raster scan format, only one line (32 pixel data) of pixel data needs to be cached; if the preset pixel unit is 1*64, only one line of 1 needs to be cached *64 pixel data, reduce the number of lines of the cached image, save the overhead of local cache, and then save the area of the chip.
  • the wavelet transform module 602 is configured to perform wavelet transform on the first input pixel to obtain wavelet transform coefficients.
  • the wavelet transform is a transformation analysis method.
  • the localized analysis of the time (or space) frequency can be performed through the transformation, and the signal can be gradually multi-scale refinement through the scaling and translation operation. , realize time subdivision at high frequency and frequency subdivision at low frequency, and automatically adapt to the requirements of time-frequency signal analysis.
  • the first input pixel when the first input pixel is subjected to wavelet transform, it can be realized by the Haar discrete wavelet transform method, and the wavelet transform coefficient is obtained; optionally, the value of the first input pixel can be The grayscale value (or luminance value) of the pixel.
  • the segmentation processing module 603 is configured to perform sub-band processing on the numerical value of the wavelet transform coefficient.
  • the wavelet transform coefficient is divided into frequency bands according to the numerical value, for example, the wavelet transform coefficient is divided into multiple frequency bands according to the numerical value, such as the lowest frequency band, the middle frequency band and the highest frequency band, etc.
  • the encoding processing module 604 is configured to perform discrete wavelet transform EZW encoding on the wavelet transform coefficients according to the frequency band corresponding to each wavelet transform coefficient.
  • EZW encoding is performed separately; for example, the first EZW encoding is performed for the highest frequency band, the second EZW encoding is performed for the middle frequency band; the third EZW encoding is performed for the lowest frequency band, the first EZW encoding, the second EZW encoding and the third EZW encoding EZW encoding is carried out independently, and different encoding rules can be used.
  • the three encoding processes can be processed in parallel, which is beneficial to the hardware acceleration of the encoding end.
  • the pixel acquisition module 601 includes:
  • the first acquisition sub-module is configured to acquire a row of the first input pixels of the to-be-encoded image pre-cached in the electronic device when the number of rows of the first input pixels is at least two, read and cache the to-be-encoded image. another line of the first input pixel of the encoded image;
  • a second acquisition sub-module configured to acquire a row of first input pixels of an image to be encoded pre-cached in the electronic device when the number of rows of the first input pixels is one row;
  • the apparatus further includes: a buffer module, configured to read and buffer a row of second input pixels of the to-be-coded image after the second acquisition sub-module acquires the first input pixels of the to-be-coded image.
  • a buffer module configured to read and buffer a row of second input pixels of the to-be-coded image after the second acquisition sub-module acquires the first input pixels of the to-be-coded image.
  • the wavelet transform module 602 includes:
  • a first transform submodule configured to perform wavelet transform in a first direction on the first input pixel to obtain a first wavelet transform coefficient
  • the second transform sub-module is configured to perform wavelet transform in the second direction on the first wavelet transform coefficients to obtain second wavelet transform coefficients.
  • the segmentation processing module 603 is configured to:
  • the second wavelet transform coefficient is divided into a first frequency band, a second frequency band and a third frequency band from low to high.
  • the encoding processing module 604 includes:
  • a rearrangement sub-module configured to rearrange the wavelet transform coefficients according to the numerical value of the second wavelet transform coefficients, and fill them into a rearrangement list; in the rearrangement list, all the The second wavelet transform coefficients correspond to different target positions.
  • the encoding processing module 604 includes:
  • a second reading submodule configured to read the second wavelet transform coefficients of different frequency bands from each of the target positions in the rearrangement list
  • the encoding sub-module is configured to perform discrete wavelet transform EZW encoding on the second wavelet transform coefficients of different frequency bands respectively.
  • the pixel obtaining module 601 obtains the first input pixel of the image to be encoded, so as to reduce the consumption of the line buffer of the input data in the raster scanning mode; the wavelet transform module 602 performs wavelet transformation on the first input pixel, and obtains Wavelet transform coefficients; the segmentation processing module 603 performs sub-band processing on the numerical value of the wavelet transform coefficients; the encoding processing module 604 performs discrete wavelet transform EZW on the wavelet transform coefficients according to the frequency band corresponding to each of the wavelet transform coefficients Encoding, the encoding process of different frequency bands is performed independently, which is beneficial to the hardware acceleration of the encoding end chip.
  • the image encoding apparatus in this embodiment of the present application may be an apparatus, and may also be a component, an integrated circuit, or a chip in a terminal.
  • the apparatus may be a mobile electronic device or a non-mobile electronic device.
  • the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (personal digital assistant).
  • UMPC ultra-mobile personal computer
  • netbook or a personal digital assistant
  • non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
  • Network Attached Storage NAS
  • personal computer personal computer, PC
  • television television
  • teller machine or self-service machine etc.
  • the image encoding apparatus in this embodiment of the present application may be an apparatus having an operating system.
  • the operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
  • the image encoding apparatus provided in the embodiments of the present application can implement each process implemented by the image encoding apparatus in the method embodiments of FIG. 1 to FIG. 5 , and to avoid repetition, details are not described here.
  • an embodiment of the present application further provides an electronic device 700, including a processor 701, a memory 702, a program or instruction stored in the memory 702 and executable on the processor 701,
  • an electronic device 700 including a processor 701, a memory 702, a program or instruction stored in the memory 702 and executable on the processor 701,
  • the program or instruction is executed by the processor 701
  • each process of the above-mentioned image coding method embodiments can be realized, and the same technical effect can be achieved. To avoid repetition, details are not described here.
  • the electronic devices in the embodiments of the present application include the aforementioned mobile electronic devices and non-mobile electronic devices.
  • FIG. 8 is a schematic diagram of a hardware structure of an electronic device 800 implementing various embodiments of the present application.
  • the electronic device 800 includes but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, a processor 810, and Power 811 and other components.
  • the electronic device 800 may also include a power supply (such as a battery) for supplying power to various components, and the power supply may be logically connected to the processor 810 through a power management system, so that the power management system can manage charging, discharging, and power management. consumption management and other functions.
  • the structure of the electronic device shown in FIG. 8 does not constitute a limitation on the electronic device.
  • the electronic device may include more or less components than the one shown, or combine some components, or arrange different components, which will not be repeated here. .
  • the processor 810 is used to obtain the first input pixel of the image to be encoded
  • the discrete wavelet transform EZW coding is performed on the wavelet transform coefficients.
  • processor 810 is used to:
  • the number of lines of the first input pixels is at least two lines, acquire a line of first input pixels of the image to be encoded pre-cached in the electronic device, read and cache another line of the first input pixel of the image to be encoded pixel;
  • the processor 810 is further configured to: read and cache a row of second input pixels of the to-be-encoded image.
  • processor 810 is used to:
  • the first wavelet transform coefficients are subjected to wavelet transform in the second direction to obtain second wavelet transform coefficients.
  • processor 810 is used to:
  • the second wavelet transform coefficient is divided into a first frequency band, a second frequency band and a third frequency band from low to high.
  • processor 810 is used to:
  • the wavelet transform coefficients are rearranged according to the numerical values of the second wavelet transform coefficients, and are filled into a rearrangement list; in the rearrangement list, the second wavelet transform coefficients of each frequency band correspond to different target locations.
  • processor 810 is used to:
  • Discrete wavelet transform EZW coding is performed on the second wavelet transform coefficients of different frequency bands respectively.
  • the first input pixel of the image to be encoded is obtained to reduce the consumption of the line buffer for the input data in the raster scanning mode; the wavelet transform is performed on the first input pixel to obtain the wavelet transform coefficient; and then the The numerical value of the wavelet transform coefficient is processed by frequency bands; finally, according to the frequency band corresponding to each wavelet transform coefficient, the wavelet transform coefficient is subjected to discrete wavelet transform EZW encoding, and the encoding process of different frequency bands is carried out independently, which is beneficial to the coding end chip. hardware acceleration.
  • the input unit 804 may include a graphics processor (Graphics Processing Unit, GPU) 8041 and a microphone 8042. Such as camera) to obtain still pictures or video image data for processing.
  • the display unit 806 may include a display panel 8061, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 807 includes a touch panel 8071 and other input devices 8072 .
  • the touch panel 8071 is also called a touch screen.
  • the touch panel 8071 may include two parts, a touch detection device and a touch controller.
  • Other input devices 8072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be described herein again.
  • Memory 809 may be used to store software programs as well as various data, including but not limited to application programs and operating systems.
  • the processor 810 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and application programs, and the like, and the modem processor mainly handles wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 810.
  • Embodiments of the present application further provide an electronic device, which is configured to execute each process of the above image coding method embodiments, and can achieve the same technical effect. To avoid repetition, details are not described here.
  • Embodiments of the present application further provide a readable storage medium, where a program or an instruction is stored on the readable storage medium.
  • a program or an instruction is stored on the readable storage medium.
  • the processor is the processor in the electronic device described in the foregoing embodiments.
  • the readable storage medium includes a computer-readable storage medium, and examples of the computer-readable storage medium include non-transitory computer-readable storage media, such as computer read-only memory (Read-Only Memory, ROM), random access memory ( Random Access Memory, RAM), disk or CD, etc.
  • An embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement the above image encoding method embodiments.
  • the chip includes a processor and a communication interface
  • the communication interface is coupled to the processor
  • the processor is configured to run a program or an instruction to implement the above image encoding method embodiments.
  • the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip, a system-on-a-chip, or a system-on-a-chip, or the like.
  • Embodiments of the present invention further provide a computer program product, which can be executed by a processor to implement the various processes of the above image coding method embodiments, and can achieve the same technical effect. To avoid repetition, details are not repeated here. .

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 present application discloses an image encoding method and apparatus, which belong to the field of mobile communications. The method comprises: acquiring first input pixels of an image to be encoded; performing wavelet transform on the first input pixels to obtain wavelet transform coefficients; performing frequency division processing on the numerical magnitude of the wavelet transform coefficients; and performing discrete wavelet transform EZW encoding on the wavelet transform coefficients according to frequency bands corresponding to each wavelet transform coefficient.

Description

图像编码方法及装置Image coding method and device
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请主张在2020年12月21日在中国提交的中国专利申请号202011524412.7的优先权,其全部内容通过引用包含于此。This application claims priority to Chinese Patent Application No. 202011524412.7 filed in China on December 21, 2020, the entire contents of which are incorporated herein by reference.
技术领域technical field
本申请属于移动通信领域,具体涉及一种图像编码方法及装置。The present application belongs to the field of mobile communications, and in particular relates to an image coding method and device.
背景技术Background technique
随着移动通信技术的迅速发展,各种移动电子设备以及非移动电子设备已成为人们生活中各方面不可或缺的工具。电子设备的各种应用程序(Application,APP)的功能也逐渐完善,不再只是单纯地起到通信作用,较多的是为用户提供各种智能化服务,给用户工作、生活带来了极大的便利。以拍摄功能为例,用户使用电子设备拍摄照片或视频已经成为日常工作生活中较为常见的场景。在电子设备的***级芯片(System On Chip,SOC)中,拍摄的分辨率越来越高,图像(包括图片以及视频帧中的图像)处理需要的带宽越来越大,因此,如何对图像数据进行高质量压缩变得越来越重要。由于无损压缩在一些诸如噪声较大的场景中不能保证足够的压缩比,并且压缩效果依赖数据内容,因此一定程度的有损压缩在图像处理中得到了广泛的应用。图像编码算法是一种以可以接受的失真为代价来换取图像数据的压缩的技术,比如基于离散余弦变换(Discrete Cosine Transform,DCT)的图像压缩技术,在联合图像专家小组(Joint Photographic Experts Group,JPEG)中得到了应用,但是其把待编码图像分块处理的过程,很容易出现“块效应”等问题。而离散小波变换(Discrete Wavelet Transformation,DWT)解决了“块效应”等问题,DWT应用于图像编码的基本思想是把图像进行多分辨率分解,分解成不 同空间、不同频率的子带图像,然后再对子图像进行系数编码。小波编码具有良好的空间、频率局部化特征,各子带的系数分布存在相似性,这就易于形成零树结构适合零树编码。With the rapid development of mobile communication technology, various mobile electronic devices and non-mobile electronic devices have become indispensable tools in all aspects of people's lives. The functions of various application programs (Application, APP) of electronic devices are also gradually improved, not just for communication, but for providing users with various intelligent services, bringing great benefits to users' work and life. Great convenience. Taking the shooting function as an example, it has become a common scene in daily work and life that users use electronic devices to shoot photos or videos. In the system-on-chip (SOC) of electronic equipment, the resolution of shooting is getting higher and higher, and the processing of images (including pictures and images in video frames) requires more and more bandwidth. Therefore, how to process images High-quality compression of data is becoming more and more important. Since lossless compression cannot guarantee a sufficient compression ratio in some noisy scenes, and the compression effect depends on the data content, a certain degree of lossy compression has been widely used in image processing. The image coding algorithm is a technology that exchanges the compression of image data at the expense of acceptable distortion, such as the image compression technology based on Discrete Cosine Transform (DCT), in the Joint Photographic Experts Group, JPEG), but the process of dividing the image to be encoded into blocks is prone to problems such as "block effect". The discrete wavelet transform (Discrete Wavelet Transformation, DWT) solves the "block effect" and other problems. The basic idea of DWT applied to image coding is to decompose the image into multi-resolution images, decompose them into sub-band images of different spaces and frequencies, and then The sub-images are then subjected to coefficient coding. Wavelet coding has good spatial and frequency localization characteristics, and the coefficient distribution of each subband is similar, which makes it easy to form a zero-tree structure and is suitable for zero-tree coding.
对DWT系数进行嵌入式零树编码的算法即嵌入式零树小波(Embedded Zerotree Wavelets,EZW)算法。然而,EZW编码对于图像光栅扫描方式,在编码端需要首先存储8行或者更多行的数据之后,才能开始进行变换和编码,同理在解码端,要经过缓存多行数据之后,才能开启解码和反变换处理,当整块数据处理完成之后才能输出第一行的数据,在芯片设计中需要消耗额外的缓存内存(memory)空间;且编码过程中对所存储的数据依次进行编码,编码耗时较长;因此,EZW编码的方式不利于芯片的硬件加速。The algorithm of embedded zerotree coding for DWT coefficients is the embedded zerotree wavelet (Embedded Zerotree Wavelets, EZW) algorithm. However, for the image raster scanning method of EZW encoding, the encoding end needs to store 8 or more lines of data before it can start to transform and encode. Similarly, in the decoding end, after caching multiple lines of data, the decoding can be started. And inverse transformation processing, the first line of data can only be output after the entire block of data is processed, and additional cache memory (memory) space needs to be consumed in the chip design; and the stored data is encoded in sequence during the encoding process. It takes a long time; therefore, the way of EZW encoding is not conducive to the hardware acceleration of the chip.
发明内容SUMMARY OF THE INVENTION
本申请实施例的目的是提供一种图像编码方法及装置,能够解决现有技术中,EZW编码的方式不利于芯片的硬件加速的问题。The purpose of the embodiments of the present application is to provide an image encoding method and apparatus, which can solve the problem in the prior art that the EZW encoding method is not conducive to the hardware acceleration of the chip.
为了解决上述技术问题,本申请是这样实现的:In order to solve the above technical problems, this application is implemented as follows:
第一方面,本申请实施例提供了一种图像编码方法,所述方法包括:In a first aspect, an embodiment of the present application provides an image encoding method, the method comprising:
获取待编码图像的第一输入像素;obtaining the first input pixel of the image to be encoded;
对所述第一输入像素进行小波变换,得到小波变换系数;performing wavelet transform on the first input pixel to obtain wavelet transform coefficients;
对所述小波变换系数的数值大小进行分频段处理;performing sub-band processing on the numerical value of the wavelet transform coefficient;
根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散小波变换EZW编码。According to the frequency band corresponding to each of the wavelet transform coefficients, the discrete wavelet transform EZW coding is performed on the wavelet transform coefficients.
第二方面,本申请实施例还提供了一种图像编码装置,所述图像编码装置包括:In a second aspect, an embodiment of the present application further provides an image encoding apparatus, where the image encoding apparatus includes:
像素获取模块,用于获取待编码图像的第一输入像素;a pixel acquisition module for acquiring the first input pixel of the image to be encoded;
小波变换模块,用于对所述第一输入像素进行小波变换,得到小波变换系数;a wavelet transform module, configured to perform wavelet transform on the first input pixel to obtain wavelet transform coefficients;
分段处理模块,用于对所述小波变换系数的数值大小进行分频段处理;a segmentation processing module, configured to perform sub-band processing on the numerical value of the wavelet transform coefficient;
编码处理模块,用于根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散小波变换EZW编码。The encoding processing module is configured to perform discrete wavelet transform EZW encoding on the wavelet transform coefficients according to the frequency band corresponding to each wavelet transform coefficient.
第三方面,本申请实施例还提供了一种电子设备,该电子设备包括存储器、处理器及存储在存储器上并可在处理器上运行的程序或指令,所述处理器执行所述程序或指令时实现如上所述的图像编码方法中的步骤。In a third aspect, an embodiment of the present application further provides an electronic device, the electronic device includes a memory, a processor, and a program or instruction stored in the memory and executable on the processor, where the processor executes the program or The steps in the image encoding method as described above are implemented when instructed.
第四方面,本申请实施例还提供了一种可读存储介质,该可读存储介质上存储有程序或指令,所述程序或指令被处理器执行时实现如上所述的图像编码方法中的步骤。In a fourth aspect, an embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the above-mentioned image encoding method is implemented. step.
第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如上所述的方法。In a fifth aspect, an embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run a program or an instruction to implement the above method.
在本申请实施例中,获取待编码图像的第一输入像素,减少光栅扫描方式输入数据的对行缓存(line buffer)的消耗;对所述第一输入像素进行小波变换,得到小波变换系数;然后对所述小波变换系数的数值大小进行分频段处理;最后根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散小波变换EZW编码,不同频段的编码过程独立进行,有利于编码端芯片的硬件加速。In the embodiment of the present application, the first input pixel of the image to be encoded is obtained, and the consumption of the line buffer (line buffer) of the input data in the raster scanning mode is reduced; the wavelet transform is performed on the first input pixel to obtain the wavelet transform coefficient; Then, the numerical value of the wavelet transform coefficient is processed by frequency bands; finally, according to the frequency band corresponding to each wavelet transform coefficient, the wavelet transform coefficient is subjected to discrete wavelet transform EZW encoding, and the encoding process of different frequency bands is performed independently, there are Conducive to the hardware acceleration of the encoder chip.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application. , for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative labor.
图1表示本申请实施例提供的图像编码方法的流程图;FIG. 1 shows a flowchart of an image encoding method provided by an embodiment of the present application;
图2表示本申请实施例提供的第一示例的流程图;FIG. 2 shows a flowchart of a first example provided by an embodiment of the present application;
图3表示本申请实施例提供的第二示例的流程图;FIG. 3 shows a flowchart of a second example provided by an embodiment of the present application;
图4表示本申请实施例提供的第三示例的流程图;FIG. 4 shows a flowchart of a third example provided by an embodiment of the present application;
图5表示本申请实施例提供的第四示例的流程图;FIG. 5 shows a flowchart of a fourth example provided by an embodiment of the present application;
图6表示本申请的实施例提供的图像编码装置的框图;6 shows a block diagram of an image encoding apparatus provided by an embodiment of the present application;
图7表示本申请的实施例提供的电子设备的框图之一;FIG. 7 shows one of the block diagrams of the electronic device provided by the embodiment of the present application;
图8表示本申请的实施例提供的电子设备的框图之二。FIG. 8 shows the second block diagram of the electronic device provided by the embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。在本申请的各种实施例中,应理解,下述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It is to be understood that reference throughout the specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic associated with the embodiment is included in at least one embodiment of the present application. Thus, appearances of "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments. In various embodiments of the present application, it should be understood that the size of the sequence numbers of the following processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be implemented in the present application. The implementation of the examples constitutes no limitation.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second" and the like in the description and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It is to be understood that data so used may be interchanged under appropriate circumstances so that embodiments of the application can be practiced in sequences other than those illustrated or described herein. In addition, "and/or" in the description and claims indicates at least one of the connected objects, and the character "/" generally indicates that the associated objects are in an "or" relationship.
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的图像编码方法进行详细地说明。The image coding method provided by the embodiments of the present application will be described in detail below through specific embodiments and application scenarios with reference to the accompanying drawings.
如图1所示,本申请一实施例提供了一种图像编码方法,应用于编码端,可选地,所述编码端可以是电子设备,所述电子设备包括各种手持设备、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其它处理设备,以及各种形式的移动台(Mobile Station,MS),终端设备 (Terminal Device)等等。As shown in FIG. 1 , an embodiment of the present application provides an image encoding method, which is applied to an encoding end. Optionally, the encoding end may be an electronic device, and the electronic device includes various handheld devices, vehicle-mounted devices, Wearable devices, computing devices, or other processing devices connected to wireless modems, as well as various forms of mobile stations (Mobile Station, MS), terminal devices (Terminal Device), and so on.
所述方法包括:步骤101至步骤104。The method includes steps 101 to 104 .
步骤101,获取待编码图像的第一输入像素。Step 101: Obtain a first input pixel of an image to be encoded.
其中,每次获取待编码图像的第一输入像素,可以获取预设像素单位个像素,预设像素单位可以是n*m,即按照预设的行数对于第一输入像素进行获取,例如预设像素单位可以是第一预设像素单位:2*32,也可以为第二预设像素单位:1*64;需要理解的是1和2是行数,64和32是每行对应的像素数目。每次按预设像素单位获取待编码图像的输入像素,并进行一次编码,在读取输入像素时,不对输入像素进行“分块”处理,以避免出现块效应;“分块”处理可以理解为将输入像素分成行数较多的情况,例如8*8,即8行的情况;或者4*16,即4行的情况。若预设像素单位是第二预设像素单位,对于光栅扫描格式的图像模式,只需缓存一行(32个像素数据)像素数据;若预设像素单位是1*64,则只需缓存一行1*64的像素数据,减少缓存图像的行数,节省了本地缓存的开销,进而节省了芯片的面积。Wherein, each time the first input pixel of the image to be encoded is obtained, a preset pixel unit may be obtained, and the preset pixel unit may be n*m, that is, the first input pixel is obtained according to the preset number of rows, for example, a preset pixel unit may be obtained. The pixel unit can be the first preset pixel unit: 2*32, or the second preset pixel unit: 1*64; it should be understood that 1 and 2 are the number of rows, and 64 and 32 are the pixels corresponding to each row number. Each time the input pixels of the image to be encoded are obtained in preset pixel units, and the encoding is performed once. When the input pixels are read, the input pixels are not "blocked" to avoid blocking effects; the "blocking" processing is understandable In order to divide the input pixels into a large number of lines, such as 8*8, that is, the case of 8 lines; or 4*16, that is, the case of 4 lines. If the preset pixel unit is the second preset pixel unit, for the image mode of the raster scan format, only one line (32 pixel data) of pixel data needs to be cached; if the preset pixel unit is 1*64, only one line of 1 needs to be cached *64 pixel data, reduce the number of lines of the cached image, save the overhead of local cache, and then save the area of the chip.
步骤102,对所述第一输入像素进行小波变换,得到小波变换系数。Step 102: Perform wavelet transform on the first input pixel to obtain wavelet transform coefficients.
其中,小波变换(Wavelet Transform,WT)是变换分析方法,通过提供一个随频率改变的“时间-频率”窗口,通过变换能够对时间(或空间)频率的局部化分析,通过伸缩平移运算对信号逐步进行多尺度细化,实现高频处时间细分、低频处频率细分,自动适应时频信号分析的要求。可选地,本申请实施例中,对所述第一输入像素进行小波变换时,可通过哈尔(haar)离散小波变换方法实现,得到与小波变换系数;可选地,第一输入像素的数值可以是像素的灰度值(或亮度值)。Among them, the wavelet transform (Wavelet Transform, WT) is a transformation analysis method. By providing a "time-frequency" window that changes with frequency, the localized analysis of the time (or space) frequency can be performed through the transformation. Gradually carry out multi-scale refinement, realize time subdivision at high frequency and frequency subdivision at low frequency, and automatically adapt to the requirements of time-frequency signal analysis. Optionally, in this embodiment of the present application, when the first input pixel is subjected to wavelet transform, it may be implemented by a Haar discrete wavelet transform method to obtain and wavelet transform coefficients; The value can be the grayscale value (or luminance value) of the pixel.
步骤103,对所述小波变换系数的数值大小进行分频段处理。 Step 103 , sub-band processing is performed on the numerical value of the wavelet transform coefficient.
得到第一输入像素的小波变换系数后,对小波变换系数依据数值大小分频段处理,比如根据数值大小依次将小波变换系数分成多个频段,比如最低频段、中间频段以及最高频段等。After the wavelet transform coefficient of the first input pixel is obtained, the wavelet transform coefficient is divided into frequency bands according to the numerical value, for example, the wavelet transform coefficient is sequentially divided into multiple frequency bands according to the numerical value, such as the lowest frequency band, the middle frequency band and the highest frequency band.
步骤104,根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散小波变换EZW编码。Step 104: Perform discrete wavelet transform EZW coding on the wavelet transform coefficients according to the frequency band corresponding to each wavelet transform coefficient.
对每个频段,分别进行EZW编码;比如对于最高频段进行第一EZW编码,对于中间频段进行第二EZW编码;对于最低频段进行第三EZW编码,第一EZW编码、第二EZW编码以及第三EZW编码分别独立进行,可采用不同的编码规则,三个编码过程可并行处理,有利于编码端的硬件加速。For each frequency band, EZW encoding is performed separately; for example, the first EZW encoding is performed for the highest frequency band, the second EZW encoding is performed for the middle frequency band; the third EZW encoding is performed for the lowest frequency band, the first EZW encoding, the second EZW encoding and the third EZW encoding EZW encoding is carried out independently, and different encoding rules can be used. The three encoding processes can be processed in parallel, which is beneficial to the hardware acceleration of the encoding end.
本申请实施例中,获取待编码图像的第一输入像素,其中第一输入像素根据预设的行数进行获取,以减少光栅扫描方式输入数据的对行缓存的消耗;对所述第一输入像素进行小波变换,得到小波变换系数;然后对所述小波变换系数的数值大小进行分频段处理;最后根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散小波变换EZW编码,不同频段的编码过程独立进行,有利于编码端芯片的硬件加速。本申请实施例解决了现有技术中,EZW编码的方式不利于芯片的硬件加速的问题。In the embodiment of the present application, the first input pixel of the image to be encoded is obtained, wherein the first input pixel is obtained according to the preset number of lines, so as to reduce the consumption of the line buffer of the input data in the raster scanning mode; Wavelet transform is performed on the pixels to obtain wavelet transform coefficients; then the numerical value of the wavelet transform coefficients is subjected to frequency division processing; finally, the wavelet transform coefficients are subjected to discrete wavelet transform EZW coding according to the frequency band corresponding to each of the wavelet transform coefficients , the encoding process of different frequency bands is carried out independently, which is beneficial to the hardware acceleration of the encoding end chip. The embodiments of the present application solve the problem that in the prior art, the EZW encoding method is not conducive to the hardware acceleration of the chip.
在一个可选实施例中,在所述第一输入像素的行数为至少两行的情况下,所述获取待编码图像的第一输入像素,包括:In an optional embodiment, when the number of lines of the first input pixels is at least two lines, the acquiring the first input pixels of the image to be encoded includes:
获取电子设备中预先缓存的待编码图像的一行第一输入像素,读取并缓存所述待编码图像的其他行第一输入像素。The first input pixels of one row of the image to be encoded that are pre-buffered in the electronic device are acquired, and the first input pixels of other rows of the image to be encoded are read and cached.
其中,对按照光栅扫描的待编码图像先在本地缓存一行,可用随机存取存储器(Random Access Memory,RAM)实现,RAM的深度为待编码图像的宽度,RAM的位宽为待编码图像像素的数据位宽。Among them, the image to be encoded according to the raster scan is first cached locally, which can be realized by random access memory (Random Access Memory, RAM). The depth of the RAM is the width of the image to be encoded, and the bit width of the RAM is the pixel width of the image to be encoded. Data bit width.
输出一行第一输入像素,然后读取并缓存其他行第一输入像素;以预设像素单位是第一预设像素单位(2*32)为例,当下一行数据(第一输入像素)到来的时候,和RAM输出的上一行的数据(第二输入像素)对齐生成2*32像素块,并执行步骤102后面流程,对该像素块进行小波变换。这样,每次缓存占据的缓存行数为两行,可以有效减小行缓存。Output the first input pixel of one row, and then read and cache the first input pixel of other rows; take the preset pixel unit as the first preset pixel unit (2*32) as an example, the next row of data (the first input pixel) arrives At this time, it is aligned with the data (second input pixel) of the previous line output from the RAM to generate a 2*32 pixel block, and the subsequent process of step 102 is performed to perform wavelet transformation on the pixel block. In this way, the number of cache lines occupied by each cache is two lines, which can effectively reduce the line cache.
在所述第一输入像素的行数为一行的情况下,所述获取待编码图像的第一输入像素,包括:When the number of lines of the first input pixel is one line, the acquiring the first input pixel of the image to be encoded includes:
获取电子设备中预先缓存的待编码图像的一行第一输入像素;所述获取待编码图像的第一输入像素之后,所述方法包括:读取并缓存所述待编码图像的一行第二输入像素。Obtaining a row of first input pixels of an image to be encoded pre-cached in the electronic device; after acquiring the first input pixels of the image to be encoded, the method includes: reading and buffering a row of second input pixels of the image to be encoded .
在所述第一输入像素的行数为一行的情况下,以预设像素单位是第二预设像素单位(1*64)为例,当下一行数据(第二输入像素)到来的时候,直接读取1*64个输入像素生成像素块,并执行步骤102后面流程,对该像素块进行小波变换;之后读取并缓存所述待编码图像的一行第二输入像素。这样,每次缓存占据的缓存行数为一行,可以有效减小行缓存。In the case where the number of lines of the first input pixel is one line, taking the preset pixel unit as the second preset pixel unit (1*64) as an example, when the next line of data (the second input pixel) arrives, directly Read 1*64 input pixels to generate a pixel block, and perform the subsequent process of step 102 to perform wavelet transform on the pixel block; then read and cache a row of the second input pixels of the to-be-encoded image. In this way, the number of cache lines occupied by each cache is one line, which can effectively reduce the line cache.
在一个可选实施例中,所述对所述第一输入像素进行小波变换,得到小波变换系数,包括:In an optional embodiment, performing wavelet transform on the first input pixel to obtain wavelet transform coefficients includes:
对所述第一输入像素进行第一方向的小波变换,得到第一小波变换系数;performing wavelet transformation in a first direction on the first input pixel to obtain a first wavelet transformation coefficient;
对所述第一小波变换系数进行第二方向的小波变换,得到第二小波变换系数。The first wavelet transform coefficients are subjected to wavelet transform in the second direction to obtain second wavelet transform coefficients.
其中,第一方向可以是垂直方向,第二方向可以是水平方向;以第一输入像素为图像的灰度值为例,小波变换的过程如下:The first direction may be the vertical direction, and the second direction may be the horizontal direction; taking the first input pixel as the gray value of the image as an example, the wavelet transform process is as follows:
第一步,参见以下表1,对于2*32个像素的灰度值Y,进行haar小波变换。The first step, referring to the following Table 1, for the gray value Y of 2*32 pixels, perform haar wavelet transform.
表1:Table 1:
Y0_0Y0_0 Y0_1Y0_1 Y0_2Y0_2 Y0_3Y0_3 ……... ……... Y0_30Y0_30 Y0_31Y0_31
Y1_1Y1_1 Y1_1Y1_1 Y1_2Y1_2 Y1_3Y1_3 ……... ……... Y1_30Y1_30 Y1_31Y1_31
其中,Y0_0表示第1行第1个Y信号,……Y0_31表示第1行第32个Y信号;Y1_0表示第2行第1个Y信号,……Y1_31表示第2行第32个Y信号;Among them, Y0_0 represents the 1st Y signal in the 1st row, ... Y0_31 represents the 32nd Y signal in the 1st row; Y1_0 represents the 1st Y signal in the 2nd row, ... Y1_31 represents the 32nd Y signal in the 2nd row;
先进行垂直(vertical)方向上的变换,分别对垂直方向上两个Y信号求和与求差:First perform the transformation in the vertical direction, and sum and difference the two Y signals in the vertical direction respectively:
(1)对第1个信号求和与求差:(1) Sum and difference the first signal:
求和项:ys0=Y0_0+Y1_0-256;其中,求和项ys减去256是为了将直流分量归0处理,使其数值与求差项yd在同一个范围区间。Summation item: ys0=Y0_0+Y1_0-256; wherein, subtracting 256 from the summation item ys is to return the DC component to 0, so that its value is in the same range as the difference item yd.
求差项:yd0=Y0_0-Y1_0;Find the difference: yd0=Y0_0-Y1_0;
(2)对第2个信号求和与求差:(2) Sum and difference the second signal:
求和项:ys1=Y0_1+Y1_1-256;Summation term: ys1=Y0_1+Y1_1-256;
求差项:yd1=Y0_1-Y1_1;Find the difference: yd1=Y0_1-Y1_1;
(3)对第3个信号求和与求差:(3) Sum and difference the third signal:
求和项:ys2=Y0_2+Y1_2-256;Summation term: ys2=Y0_2+Y1_2-256;
求差项:yd2=Y0_2-Y1_2;Find the difference: yd2=Y0_2-Y1_2;
(32)对第32个信号求和与求差:(32) Sum and difference the 32nd signal:
ys31=Y0_31+Y1_31-256;ys31=Y0_31+Y1_31-256;
yd31=Y0_31-Y1_31;yd31=Y0_31-Y1_31;
则ys0至ys31,yd0至yd31为第一小波变换系数。Then ys0 to ys31 and yd0 to yd31 are the first wavelet transform coefficients.
第二步,进行水平(horizontal)方向上的变换。The second step is to transform in the horizontal direction.
2.1首先对ys进行变换;2.1 First transform ys;
(1)低频系数(1) Low frequency coefficient
低频系数为全部求和项系数之和,如以下公式所示:The low frequency coefficient is the sum of all summation term coefficients, as shown in the following formula:
scoef0=ys0+ys1+…+ys31;scoef0=ys0+ys1+…+ys31;
(2)一阶高频系数(2) First-order high-frequency coefficient
一阶高频系数为前16个求和项系数(ys0至ys15)减去后16个求和项系数(ys16至ys31),得到第一系数scoef1,如以下公式所示:The first-order high-frequency coefficients are the first 16 summation term coefficients (ys0 to ys15) minus the last 16 summation term coefficients (ys16 to ys31) to obtain the first coefficient scoef1, as shown in the following formula:
scoef1=ys0+ys2+…+ys15-ys16-ys17-…-ys31;scoef1=ys0+ys2+…+ys15-ys16-ys17-…-ys31;
(3)二阶高频系数(3) Second-order high frequency coefficient
二阶高频系数有两个,分别将32个求和项系数分成前后两组,每组分别按照(2)中方式进行内部求差;求得差值之后,对每个差值乘以√2得到第二系数scoef2、第三系数scoef3,以对haar小波系数进行归一化。There are two second-order high-frequency coefficients. The 32 summation term coefficients are divided into two groups before and after, and each group is internally calculated according to the method in (2); after the difference is obtained, each difference is multiplied by √ 2 Obtain the second coefficient scoef2 and the third coefficient scoef3 to normalize the haar wavelet coefficients.
参见以下公式:See the following formula:
scoef2=(ys0+ys1+…+ys7-ys8-…-ys14-ys15)*√2;scoef2=(ys0+ys1+…+ys7-ys8-…-ys14-ys15)*√2;
scoef3=(ys16+ys17+…+ys23-ys24-…-ys30-ys31)*√2;scoef3=(ys16+ys17+…+ys23-ys24-…-ys30-ys31)*√2;
(4)三阶高频系数(4) Third-order high frequency coefficient
三阶高频系数有4个,分别将32个ys等分成4组,每组按照(2)中方式进行内部求差,分别得到第四系数scoef4、第五系数scoef5、第六系数scoef6、第七系数scoef7,具体地:There are 4 third-order high-frequency coefficients, and the 32 ys are divided into 4 groups. Each group is internally calculated according to the method in (2), and the fourth coefficient scoef4, the fifth coefficient scoef5, the sixth coefficient scoef6, the third coefficient are obtained respectively. The seven-factor scoef7, specifically:
scoef4=(ys0+ys1…+ys3-ys4-ys5-…-ys7)*2;scoef4=(ys0+ys1...+ys3-ys4-ys5-...-ys7)*2;
scoef5=(ys8+ys9…+ys11-ys12-ys13-…-ys15)*2;scoef5=(ys8+ys9…+ys11-ys12-ys13-…-ys15)*2;
scoef6=(ys16+ys16…+ys19-ys20-ys21-…-ys23)*2;scoef6=(ys16+ys16…+ys19-ys20-ys21-…-ys23)*2;
scoef7=(ys24+ys25…+ys27-ys28-ys29-…-ys31)*2;scoef7=(ys24+ys25…+ys27-ys28-ys29-…-ys31)*2;
(5)四阶高频系数(5) Fourth-order high-frequency coefficient
4阶高频系数有8个,分别将32个ys等分成8组,每组按照(2)中方式进行内部求差,得到第八系数scoef8,第九系数scoef9,……第十五系数scoef15,具体地:There are 8 4th-order high-frequency coefficients, 32 ys are divided into 8 groups, and each group is internally calculated according to the method in (2) to obtain the eighth coefficient scoef8, the ninth coefficient scoef9, ... the fifteenth coefficient scoef15 ,specifically:
scoef8=(ys0+ys1-ys2-ys3)*2√2;scoef8=(ys0+ys1-ys2-ys3)*2√2;
scoef9=(ys4+ys5-ys6-ys7)*2√2;scoef9=(ys4+ys5-ys6-ys7)*2√2;
scoef10=(ys8+ys9-ys10-ys11)*2√2;scoef10=(ys8+ys9-ys10-ys11)*2√2;
scoef11=(ys12+ys13-ys14-ys15)*2√2;scoef11=(ys12+ys13-ys14-ys15)*2√2;
Scoef15=(ys28+ys29-ys30-ys31)*2√2Scoef15=(ys28+ys29-ys30-ys31)*2√2
(6)六阶高频系数(6) Sixth-order high frequency coefficient
六阶高频系数有16个,分别将32个ys等分成16组,得到第十六系数scoef16至第三十一系数scoef31,每组按照(2)中方式进行内部求差:There are 16 sixth-order high-frequency coefficients, and the 32 ys are divided into 16 groups to obtain the sixteenth coefficient scoef16 to the thirty-first coefficient scoef31, and each group is internally calculated according to the method in (2):
具体地,scoef16=(ys0-ys1)*4;Specifically, scoef16=(ys0-ys1)*4;
scoef17=(ys2-ys3)*4;scoef17=(ys2-ys3)*4;
scoef18=(ys4-ys5)*4;scoef18=(ys4-ys5)*4;
scoef19=(ys6-ys7)*4;scoef19=(ys6-ys7)*4;
scoef31=(ys30-ys31)*4。scoef31=(ys30-ys31)*4.
2.2首先对yd进行变换,按照上述2.1的方式,求得yd的小波变换系数dcoef0至dcoef31,过程与2.1相同,在此不再赘述。2.2 First transform yd, and obtain the wavelet transform coefficients dcoef0 to dcoef31 of yd according to the method of 2.1 above. The process is the same as that in 2.1, and will not be repeated here.
ys对应的scoef0至scoef31,以及yd对应的dcoef0至dcoef31均为第二小波变换系数。scoef0 to scoef31 corresponding to ys and dcoef0 to dcoef31 corresponding to yd are the second wavelet transform coefficients.
在一个可选实施例中,所述对所述小波变换系数的数值大小进行分频 段处理,包括:In an optional embodiment, performing frequency division processing on the numerical value of the wavelet transform coefficient, including:
根据所述第二小波变换系数的数值大小,由低至高将所述第二小波变换系数分成第一频段、第二频段以及第三频段。According to the numerical value of the second wavelet transform coefficient, the second wavelet transform coefficient is divided into a first frequency band, a second frequency band and a third frequency band from low to high.
第一频段即最低频段,第二频段即中间频段,第三频段即最高频段。The first frequency band is the lowest frequency band, the second frequency band is the middle frequency band, and the third frequency band is the highest frequency band.
可选地,所述根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散小波变换EZW编码,包括:Optionally, performing discrete wavelet transform EZW coding on the wavelet transform coefficients according to the frequency band corresponding to each of the wavelet transform coefficients, including:
根据所述第二小波变换系数的数值大小对所述小波变换系数进行重排列,并填充到重排列表中;所述重排列表中,每个所述频段的所述第二小波变换系数对应不同的目标位置。The wavelet transform coefficients are rearranged according to the numerical values of the second wavelet transform coefficients, and are filled into a rearrangement list; in the rearrangement list, the second wavelet transform coefficients of each frequency band correspond to different target locations.
由于小波系数中低频部分(即最低频段)包含了更多的能量信息,重排列的目的是对小波系数中的第一频段系数、第二频段系数尽量前移,以增加优先对较大系数进行编码的可能性,从而大幅度降低重构误差。Since the low frequency part (ie the lowest frequency band) in the wavelet coefficients contains more energy information, the purpose of rearranging is to move the first frequency band coefficients and the second frequency band coefficients in the wavelet coefficients forward as much as possible, so as to increase the priority of the larger coefficients. The possibility of encoding, thereby greatly reducing the reconstruction error.
具体地,重排列的过程包括按照从低频到高频的系数顺序将第二小波变换系数按照迂回扫描的顺序放到8*8的方形表中。具体的重排列方式为:Specifically, the rearrangement process includes placing the second wavelet transform coefficients in an 8*8 square table in the order of detour scanning in the order of coefficients from low frequency to high frequency. The specific rearrangement method is:
第一频段:First frequency band:
(1)LL3=scoef0,HL3=scoef1;LH3=dcoef0,HH3=dscoef1;(1) LL3=scoef0, HL3=scoef1; LH3=dcoef0, HH3=dscoef1;
第二频段:Second frequency band:
(2)HL2包括4个数,分别为scoef2、scoef3、dcoef2、dcoef3;(2) HL2 includes 4 numbers, namely scoef2, scoef3, dcoef2, and dcoef3;
(3)LH2包括4个数,分别为scoef4、scoef5、scoef6、scoef7;(3) LH2 includes 4 numbers, namely scoef4, scoef5, scoef6, and scoef7;
(4)HL2包括4个数,分别为dcoef4、dcoef5、dcoef6、dcoef7;(4) HL2 includes 4 numbers, namely dcoef4, dcoef5, dcoef6, and dcoef7;
第三频段:The third frequency band:
(5)HL1包括16个数,内部按照Z方式扫描排列;其中,(5) HL1 includes 16 numbers, which are scanned and arranged in Z mode; among them,
左上4个数:scoef8、scoef9、scoef10、scoef11;4 numbers in the upper left: scoef8, scoef9, scoef10, scoef11;
右上4个数:scoef12、scoef13、scoef14、scoef15;4 numbers in the upper right: scoef12, scoef13, scoef14, scoef15;
左下4个数:dcoef8、dcoef9、dcoef10、dcoef11;4 numbers in the lower left: dcoef8, dcoef9, dcoef10, dcoef11;
右下4个数:dcoef12、dcoef13、dcoef14、dcoef15;4 numbers in the lower right: dcoef12, dcoef13, dcoef14, dcoef15;
(6)LH1包括16个数,内部按照Z方式扫描排列;其中,(6) LH1 includes 16 numbers, and the interior is arranged according to the Z scan; among them,
左上4个数:scoef16、scoef17、scoef18、scoef19;4 numbers in the upper left: scoef16, scoef17, scoef18, scoef19;
右上4个数:scoef20、scoef21、scoef22、scoef23;4 numbers in the upper right: scoef20, scoef21, scoef22, scoef23;
左下4个数:scoef24、scoef25、scoef26、scoef27;4 numbers in the lower left: scoef24, scoef25, scoef26, scoef27;
右下4个数:scoef28、scoef29、scoef30、scoef31;4 numbers in the lower right: scoef28, scoef29, scoef30, scoef31;
(7)HH1包括16个数,内部按照Z方式扫描排列;其中,(7) HH1 includes 16 numbers, and the interior is arranged according to the Z scan; among them,
左上4个数:dcoef16、dcoef17、dcoef18、dcoef19;4 numbers in the upper left: dcoef16, dcoef17, dcoef18, dcoef19;
右上4个数:dcoef20、dcoef21、dcoef22、dcoef23;4 numbers in the upper right: dcoef20, dcoef21, dcoef22, dcoef23;
左下4个数:dcoef16、dcoef17、dcoef18、dcoef19;4 numbers in the lower left: dcoef16, dcoef17, dcoef18, dcoef19;
右下4个数:dcoef20、dcoef21、dcoef22、dcoef23;4 numbers in the lower right: dcoef20, dcoef21, dcoef22, dcoef23;
将第二小波变换系数填充到重排列表中;所述重排列表中,每个所述频段的所述第二小波变换系数对应不同的目标位置,重排列后的方形表如以下表2所示:Fill the second wavelet transform coefficients into the rearrangement list; in the rearrangement list, the second wavelet transform coefficients of each of the frequency bands correspond to different target positions, and the rearranged square table is shown in Table 2 below. Show:
表2:Table 2:
Figure PCTCN2021137657-appb-000001
Figure PCTCN2021137657-appb-000001
得到上述重排列表后,所述对所述小波变换系数进行离散小波变换EZW编码,包括:After the above-mentioned rearrangement list is obtained, performing discrete wavelet transform EZW coding on the wavelet transform coefficients includes:
从所述重排列表中每个所述目标位置中,读取不同频段的所述第二小波变换系数;比如读取第一频段时,从重排列表的左上角分别读取LL3至HH3,按照Z方向进行扫描。From each of the target positions in the rearrangement list, read the second wavelet transform coefficients of different frequency bands; for example, when reading the first frequency band, read LL3 to HH3 from the upper left corner of the rearrangement list, respectively, Scan in the Z direction.
分别对不同频段的所述第二小波变换系数进行离散小波变换EZW编码。Discrete wavelet transform EZW coding is performed on the second wavelet transform coefficients of different frequency bands respectively.
具体地,在EZW编码过程中,根据小波变换系数是否大于设定的阈值,分成正重要系数(POS),负重要系数(NEG),零树根(ZTR)以及孤立零点(IZ)四种状态。在逐个小波变换系数扫描过程中,用一个主扫描表记录这些输出符号,当一个系数的输出符号为零树根时,它的所有子孙系数都不再进行扫描;在辅扫描中对主扫描中判断为重要的系数进行细化处理。在DCT或者DWT的通用处理方法中,通常需要将图像按照 8*8或者更大正方形的分块处理,使得直接内存读取(Direct Memory Access,DMA)的数据读取方式可以实现。Specifically, in the EZW encoding process, according to whether the wavelet transform coefficient is greater than the set threshold, it is divided into four states: positive significance coefficient (POS), negative significance coefficient (NEG), zero tree root (ZTR) and isolated zero point (IZ). . In the scanning process of wavelet transform coefficients one by one, a main scanning table is used to record these output symbols. When the output symbol of a coefficient is zero tree root, all its descendant coefficients are no longer scanned; Coefficients judged to be important are refined. In the general processing method of DCT or DWT, the image usually needs to be processed in 8*8 or larger square blocks, so that the data reading method of Direct Memory Access (DMA) can be realized.
作为第一示例,如图2所示。图2提供了一种分别对不同频段的所述第二小波变换系数进行EZW编码的示例,主要包括:步骤201至步骤210。As a first example, as shown in FIG. 2 . FIG. 2 provides an example of performing EZW encoding on the second wavelet transform coefficients of different frequency bands respectively, which mainly includes steps 201 to 210 .
步骤201,取最高bit平面n;其中,最高位(bit)平面和最低位平面分别为第二小波变换系数的二进制的最高bit和最低bit。 Step 201, take the highest bit plane n; wherein, the highest bit plane and the lowest bit plane are the binary highest bit and the lowest bit of the second wavelet transform coefficient, respectively.
步骤202,对第一频段进行编码; Step 202, encoding the first frequency band;
步骤203,判断是否达到目标速率R;若是,执行步骤209;若否,执行步骤204;目标速率R为预设编码速率。 Step 203, determine whether the target rate R is reached; if yes, go to step 209; if not, go to step 204; the target rate R is the preset encoding rate.
步骤204,对第二频段进行编码; Step 204, encoding the second frequency band;
步骤205,判断是否达到目标速率R;若是,执行步骤209;若否,执行步骤206; Step 205, determine whether the target rate R is reached; if yes, go to step 209; if not, go to step 206;
步骤206,对第三频段进行编码; Step 206, encoding the third frequency band;
步骤207,判断是否达到目标速率R;若是,执行步骤209;若否,执行步骤208; Step 207, judge whether the target rate R is reached; if yes, go to step 209; if not, go to step 208;
步骤208,判断是否达到最低bit平面(即n=0);若是,执行步骤209;若否,执行步骤210; Step 208, determine whether the lowest bit plane is reached (ie, n=0); if so, go to step 209; if not, go to step 210;
步骤209,编码结束; Step 209, the encoding ends;
步骤210,设置n=n-1,并返回步骤202,对下一个位平面继续编码。 Step 210, set n=n-1, and return to step 202 to continue coding for the next bit plane.
在编码过程中,首先初始化ps=0,pz=0,然后从最高bit平面到最低bit平面依次遍历;假设bit平面范围k=15(也就是最高bit平面是15),最低bit平面是1。bit平面可以用4bit(范围0-15,可以表示最高bit平面值15)来表示。In the encoding process, first initialize ps=0, pz=0, and then traverse from the highest bit plane to the lowest bit plane; assuming that the bit plane range k=15 (that is, the highest bit plane is 15), and the lowest bit plane is 1. The bit plane can be represented by 4 bits (range 0-15, which can represent the highest bit plane value of 15).
第一次循环的时候,取的是15bit平面,对上一个平面的重要节点情况ps、上一个平面的零树根情况pz、当前bit平面的重要节点cs、当前bit平面的零树根情况cz进行排列组合编码。In the first cycle, the 15-bit plane is taken. For the important node situation ps of the previous plane, the zero tree root situation pz of the previous plane, the important node cs of the current bit plane, and the zero tree root situation cz of the current bit plane Perform permutation and combination coding.
具体地,小波系数符号用s表示,其绝对值对应位平面n下的值用m表示。用cs表示当前位平面n下小波系数是否为重要节点状态,cs的值等 于m;Specifically, the symbol of the wavelet coefficient is denoted by s, and its absolute value corresponding to the value in the bit plane n is denoted by m. Use cs to indicate whether the wavelet coefficients under the current bit plane n are important node states, and the value of cs is equal to m;
cz表示当前位平面n下小波系数是否为零树节点状态,零树节点的判断条件为该系数所有的后代系数(不包括其本身)均为不重要系数;cz indicates whether the wavelet coefficient in the current bit plane n is in the state of a zero-tree node, and the judgment condition of the zero-tree node is that all descendant coefficients (excluding itself) of the coefficient are unimportant coefficients;
ps表示上一个位平面n+1下小波系数重要节点的状态;ps represents the state of the important node of the wavelet coefficient in the previous bit plane n+1;
pz表示上一个位平面n+1下小波系数零树节点的状态。pz represents the state of the wavelet coefficient zero tree node in the previous bit plane n+1.
作为第二示例,如图3所示。对于第一频段的第二小波变换系数进行离散小波变换EZW编码的过程,主要包括:步骤301至步骤314。As a second example, as shown in FIG. 3 . The process of performing discrete wavelet transform EZW coding on the second wavelet transform coefficients of the first frequency band mainly includes steps 301 to 314 .
步骤301,从位平面n开始对低频进行编码处理。 Step 301, start from bit plane n to encode the low frequency.
步骤302,判断上一个位平面n+1是否为重要节点(即ps=1);若是,执行步骤303,否则执行步骤304; Step 302, determine whether the previous bit plane n+1 is an important node (ie ps=1); if so, go to step 303, otherwise go to step 304;
步骤303,输出{cz,m}。 Step 303, output {cz, m}.
如果{ps,pz,cs,cz}=(4’b)10xx,输出{cz,m}If {ps, pz, cs, cz} = (4'b)10xx, output {cz, m}
其中,ps=1,说明当前节点已经被判断为重要节点了;但是pz=0,说明直到当前的bit平面,子代节点都是非重要节点,需要记录当前节点的零树根状态cz,此时cs被替换成了m,因为cs=ps|m;当ps=0的时候,cs和m的是相同的,m即当前节点的对应的bit平面的对应的系数的二进制状态值。Among them, ps=1, indicating that the current node has been judged as an important node; but pz=0, indicating that until the current bit plane, the descendant nodes are all non-important nodes, and the zero tree root state cz of the current node needs to be recorded. cs is replaced by m, because cs=ps|m; when ps=0, cs and m are the same, and m is the binary state value of the corresponding coefficient of the corresponding bit plane of the current node.
步骤304,判断上一个位平面n+1是否为零树节点(pz=0):若是,执行步骤308,否则执行步骤305; Step 304, determine whether the previous bit plane n+1 is a zero tree node (pz=0): if so, go to step 308, otherwise go to step 305;
步骤305,判断当前位平面n是否重要节点(cs=1):若是,执行步骤306,否则执行步骤307; Step 305, determine whether the current bit plane n is an important node (cs=1): if so, go to step 306, otherwise go to step 307;
步骤306,输出{s,cs}; Step 306, output {s, cs};
如果{ps,pz,cs,cz}=011x,输出{s,cs}If {ps, pz, cs, cz} = 011x, output {s, cs}
pz=1,那么cz不重要了,所以cz是x;但是cs=1,ps=0可以确定是第一次出现系数被判断为重要系数,如果不是第一次则ps等于1。第一次出现当前节点被判断为重要系数需要输出符号s。pz=1, then cz is not important, so cz is x; but cs=1, ps=0 can determine that the first occurrence of the coefficient is judged as an important coefficient, if it is not the first time, ps is equal to 1. The first time the current node is judged to be an important coefficient needs to output the symbol s.
步骤307,输出{cs}; Step 307, output {cs};
{ps,pz,cs,cz}=010x,输出{cs};{ps, pz, cs, cz} = 010x, output {cs};
pz=1,那么cz不重要了,所以cz是x;cs=0,表示当前位平面n下小 波系数不为重要节点状态,输出cs即可。pz=1, then cz is not important, so cz is x; cs=0, it means that the wavelet coefficient under the current bit plane n is not an important node state, just output cs.
步骤308,判断当前位平面n是否为重要节点(cs=1):若是,执行步骤309,否则执行步骤310; Step 308, determine whether the current bit plane n is an important node (cs=1): if so, go to step 309, otherwise go to step 310;
步骤309,{ps,pz,cs,cz}=001x,输出{cz,s,cs,n}; Step 309, {ps, pz, cs, cz}=001x, output {cz, s, cs, n};
cs=1,当前节点为重要节点,而ps,pz=0,说明是第一次判断到该节点为重要节点,需要记录bit平面n,而当前点是否是零树根节点都需要记录bit平面n。同时,第一次判断重要节点的时候需要带上该系数的符号s。由于pz=0,所以需要记录当前cz的值,再下一个bit平面的时候,当前平面的cz作为下一个平面的pz来参与判断。cs=1, the current node is an important node, and ps, pz=0, indicating that it is the first time that the node is an important node, and the bit plane n needs to be recorded, and whether the current point is the zero tree root node needs to record the bit plane. n. At the same time, when judging important nodes for the first time, you need to bring the symbol s of the coefficient. Since pz=0, it is necessary to record the value of the current cz. When the next bit plane is used, the cz of the current plane is used as the pz of the next plane to participate in the judgment.
步骤310,判断当前位平面n是否为零树节点(cz=0);若是,执行步骤311,否则执行步骤312; Step 310, determine whether the current bit plane n is a zero tree node (cz=0); if so, go to step 311, otherwise go to step 312;
步骤311,{ps,pz,cs,cz}=0000,不编码输出; Step 311, {ps, pz, cs, cz}=0000, output without encoding;
ps,pz等于0是初始化的结果;cs为0表示在该bit平面节点1对应的bit位的二进制是0,cz=0表示其子代节点的cs也都是0(节点1可以理解为其他多有节点的父节点),所有的系数的bit位平面全是0,没有编码的必要,如果从高到低bit平面连续多次这种情况的话,说明高位连续多次小波系数都是0,数据有很大的冗余。ps, pz equal to 0 is the result of initialization; cs being 0 means that the binary of the bit corresponding to node 1 in the bit plane is 0, and cz=0 means that the cs of its descendant nodes are also 0 (node 1 can be understood as other There are many parent nodes of nodes), the bit planes of all coefficients are all 0, and there is no need for coding. If there are consecutive times from high to low bit planes, it means that the high-order consecutive wavelet coefficients are all 0. There is a lot of redundancy in the data.
步骤312,{ps,pz,cs,cz}=0001,输出{cs,n}; Step 312, {ps, pz, cs, cz}=0001, output {cs, n};
cz=1,表示当前位平面n下小波系数为零树节点状态,表示有子代节点在该bit平面n是非0,是重要节点,需要记录该bit平面n,同时低频节点是非重要节点cs=0也需要记录,作为下一个bit平面的ps=0输入。cz=1, indicating that the wavelet coefficient under the current bit plane n is a zero tree node state, indicating that there are child nodes in the bit plane n that are non-zero and are important nodes, the bit plane n needs to be recorded, and the low-frequency nodes are non-important nodes cs= 0 also needs to be recorded, as the ps=0 input of the next bit plane.
步骤313,上述步骤中有无编码输出时,均更新ps=cs,pz=cz; Step 313, when there is any encoding output in the above steps, update ps=cs, pz=cz;
步骤314,结束位平面n低频编码。 Step 314, end the low-frequency coding of bit plane n.
作为第三示例,如图4所示。对于第二频段的第二小波变换系数进行离散小波变换EZW编码的过程,主要包括:步骤401至步骤417。As a third example, as shown in FIG. 4 . The process of performing discrete wavelet transform EZW coding on the second wavelet transform coefficients of the second frequency band mainly includes steps 401 to 417 .
对第二频段编码,从最高位平面(系数最高bit)到最低位平面(系数最低bit,即0)依次处理。需要编码的系数为15个,对于最高位平面,初始化ps=0,pz=1。其中父节点的零树根状态用fz标识,fz[i]=cZ[i/4];The coding of the second frequency band is processed sequentially from the highest bit plane (the highest bit of the coefficient) to the lowest bit plane (the lowest bit of the coefficient, that is, 0). The number of coefficients to be coded is 15. For the highest bit plane, ps=0 and pz=1 are initialized. The zero tree root state of the parent node is identified by fz, fz[i]=cZ[i/4];
步骤401,取第一个第二小波变换系数; Step 401, take the first second wavelet transform coefficient;
步骤402,判断父节点是否为零树节点(fz=0); Step 402, determine whether the parent node is a zero tree node (fz=0);
若是,执行步骤403,否则执行步骤404;If yes, go to step 403, otherwise go to step 404;
步骤403,不编码输出。 Step 403, output without encoding.
父节点已经判断了子代都是非重要节点,直接跳过编码。The parent node has already judged that the children are all non-important nodes, and the encoding is skipped directly.
步骤404,判断上一个位平面n+1是否为重要节点(ps=1):若是,执行步骤405,否则执行步骤408; Step 404, determine whether the previous bit plane n+1 is an important node (ps=1): if so, go to step 405, otherwise go to step 408;
步骤405,判断上一个位平面n+1是否为零树节点(pz=0):若是,执行步骤406,否则执行步骤407; Step 405, determine whether the previous bit plane n+1 is a zero tree node (pz=0): if so, go to step 406, otherwise go to step 407;
步骤406,{fz,ps,pz,cs}=111x,输出{m}; Step 406, {fz, ps, pz, cs}=111x, output {m};
步骤407,{fz,ps,pz,cs}=110x,输出{cz,m}; Step 407, {fz, ps, pz, cs}=110x, output {cz, m};
pz=0,所以需要记录cz,ps=1,根据cs=ps|m,不能用cs来代替m了,需要记录m本身。pz=0, so it is necessary to record cz and ps=1. According to cs=ps|m, cs cannot be used to replace m, and m itself needs to be recorded.
步骤408,判断上一个位平面n+1是否为零树节点(pz=0):若是,执行步骤412,否则执行步骤409; Step 408, determine whether the previous bit plane n+1 is a zero tree node (pz=0): if so, go to step 412, otherwise go to step 409;
步骤409,判断上一个位平面n+1是否重要节点(cs=1):若是,执行步骤410,否则执行步骤411; Step 409, determine whether the previous bit plane n+1 is an important node (cs=1): if so, go to step 410, otherwise go to step 411;
步骤410,输出{s,cs}; Step 410, output {s, cs};
如果{ps,pz,cs,cz}=0011,输出{s,cs};If {ps, pz, cs, cz} = 0011, output {s, cs};
步骤411,{fz,ps,pz,cs}=1010,输出{cs};Step 411, {fz, ps, pz, cs}=1010, output {cs};
pz=1,说明在上一个bit平面已经判断出了子代有重要节点,当前cz不需要重复记录了,ps=0,cs需要向下一个bit平面传递作为下一个bit平面的ps。pz=1, indicating that the child has been judged to have important nodes in the previous bit plane, the current cz does not need to be repeatedly recorded, ps=0, cs needs to be passed to the next bit plane as the ps of the next bit plane.
步骤412,判断当前位平面n是否重要节点(cs=1):若是,执行步骤413,否则执行步骤414; Step 412, determine whether the current bit plane n is an important node (cs=1): if so, go to step 413, otherwise go to step 414;
步骤413,输出{cz,s,cs}; Step 413, output {cz, s, cs};
步骤414,输出{cz,n};Step 414, output {cz, n};
步骤415,上述步骤中有无编码输出时,均更新ps=cs,pz=cz; Step 415, when there is any encoding output in the above steps, update ps=cs, pz=cz;
步骤416,判断达到了目标速率R;若是,执行步骤417,否则去下一个系数继续执行步骤401至416; Step 416, determine that the target rate R is reached; if so, execute step 417, otherwise go to the next coefficient and continue to execute steps 401 to 416;
步骤417,结束编码 Step 417, end encoding
作为第四示例,如图5所示。对于第三频段的第二小波变换系数进行离散小波变换EZW编码的过程,主要包括:步骤501至步骤511。As a fourth example, as shown in FIG. 5 . The process of performing discrete wavelet transform EZW coding on the second wavelet transform coefficients of the third frequency band mainly includes steps 501 to 511 .
步骤501,取第一个第二小波变换系数; Step 501, take the first second wavelet transform coefficient;
步骤502,判断父节点是否为零树节点(fz=0); Step 502, determine whether the parent node is a zero tree node (fz=0);
若是,执行步骤503,否则执行步骤504;If yes, go to step 503, otherwise go to step 504;
步骤503,不编码输出。 Step 503, output without encoding.
{fz,ps,cs}=0xx,无编码输出;父节点已经判断了子代都是非重要节点,直接跳过编码。{fz, ps, cs}=0xx, no encoding output; the parent node has already judged that the children are all non-important nodes, and the encoding is skipped directly.
步骤504,判断上一个位平面n+1是否为零树节点(pz=0):若是,执行步骤505,否则执行步骤506; Step 504, determine whether the previous bit plane n+1 is a zero tree node (pz=0): if so, go to step 505, otherwise go to step 506;
步骤505,输出m; Step 505, output m;
步骤506,判断当前位平面n是否重要节点(cs=1):若是,执行步骤507,否则执行步骤508; Step 506, determine whether the current bit plane n is an important node (cs=1): if so, go to step 507, otherwise go to step 508;
步骤507,输出{s,cs}; Step 507, output {s, cs};
步骤508,输出{cs}; Step 508, output {cs};
步骤509,上述步骤中有无编码输出时,均更新ps=cs,pz=cz;Step 509, when there is any encoding output in the above steps, update ps=cs, pz=cz;
步骤510,判断达到了目标速率R;若是,执行步骤510,否则去下一个系数继续执行步骤501至511;Step 510, determine that the target rate R is reached; if so, execute step 510, otherwise go to the next coefficient and continue to execute steps 501 to 511;
步骤511,结束编码;Step 511, end encoding;
ps,pz等于0是初始化的结果;cs为0表示在该bit平面节点1对应的bit位的二进制是0,cz=0表示其子代节点的cs也都是0(节点1可以理解为其他多有节点的父节点),所有的系数的bit位平面全是0,没有编码的必要,如果从高到低bit平面连续多次这种情况的话,说明高位连续多次小波系数都是0,数据有很大的冗余。ps, pz equal to 0 is the result of initialization; cs being 0 means that the binary of the bit corresponding to node 1 in the bit plane is 0, and cz=0 means that the cs of its descendant nodes are also 0 (node 1 can be understood as other There are many parent nodes of nodes), the bit planes of all coefficients are all 0, and there is no need for coding. If there are consecutive times from high to low bit planes, it means that the high-order consecutive wavelet coefficients are all 0. There is a lot of redundancy in the data.
本申请实施例中,获取待编码图像的第一输入像素,减少光栅扫描方式输入数据的对行缓存的消耗;对所述第一输入像素进行小波变换,得到小波变换系数;然后对所述小波变换系数的数值大小进行分频段处理;最后根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散 小波变换EZW编码,不同频段的编码过程独立进行,有利于编码端芯片的硬件加速。In the embodiment of the present application, the first input pixel of the image to be encoded is obtained to reduce the consumption of the line buffer for the input data in the raster scanning mode; the wavelet transform is performed on the first input pixel to obtain the wavelet transform coefficient; The numerical value of the transform coefficient is processed by frequency band; finally, according to the frequency band corresponding to each wavelet transform coefficient, the wavelet transform coefficient is subjected to discrete wavelet transform EZW encoding, and the encoding process of different frequency bands is carried out independently, which is beneficial to the coding end chip. Hardware Acceleration.
以上介绍了本申请实施例提供的图像编码方法,下面将结合附图介绍本申请实施例提供的图像编码装置。The image encoding method provided by the embodiments of the present application has been described above, and the image encoding apparatus provided by the embodiments of the present application will be described below with reference to the accompanying drawings.
需要说明的是,本申请实施例提供的图像编码方法,执行主体可以为图像编码装置,或者该图像编码装置中的用于执行图像编码方法的控制模块。本申请实施例中以图像编码装置执行图像编码方法为例,说明本申请实施例提供的图像编码方法。It should be noted that, in the image encoding method provided by the embodiments of the present application, the execution body may be an image encoding apparatus, or a control module in the image encoding apparatus for executing the image encoding method. In the embodiments of the present application, an image encoding method performed by an image encoding apparatus is used as an example to describe the image encoding method provided by the embodiments of the present application.
如图6所示。本申请实施例还提供了一种图像编码装置600,包括:像素获取模块601、小波变换模块602、分段处理模块603和编码处理模块604。As shown in Figure 6. The embodiment of the present application further provides an image encoding apparatus 600 , including: a pixel acquisition module 601 , a wavelet transform module 602 , a segmentation processing module 603 and an encoding processing module 604 .
像素获取模块601,用于获取待编码图像的第一输入像素。The pixel obtaining module 601 is configured to obtain the first input pixel of the image to be encoded.
其中,预设像素单位可以是第一预设像素单位或第二预设像素单位;第一预设像素单位为2*32,第二预设像素单位为1*64;每次以预设像素单位个第一输入像素为单位进行一次编码,在读取输入像素时,不对输入像素进行“分块”处理,以避免出现块效应。若预设像素单位是第二预设像素单位,对于光栅扫描格式的图像模式,只需缓存一行(32个像素数据)像素数据;若预设像素单位是1*64,则只需缓存一行1*64的像素数据,减少缓存图像的行数,节省了本地缓存的开销,进而节省了芯片的面积。The preset pixel unit may be the first preset pixel unit or the second preset pixel unit; the first preset pixel unit is 2*32, and the second preset pixel unit is 1*64; Encoding is performed once per unit of the first input pixel, and when the input pixel is read, the input pixel is not "blocked" to avoid block effects. If the preset pixel unit is the second preset pixel unit, for the image mode of the raster scan format, only one line (32 pixel data) of pixel data needs to be cached; if the preset pixel unit is 1*64, only one line of 1 needs to be cached *64 pixel data, reduce the number of lines of the cached image, save the overhead of local cache, and then save the area of the chip.
小波变换模块602,用于对所述第一输入像素进行小波变换,得到小波变换系数。The wavelet transform module 602 is configured to perform wavelet transform on the first input pixel to obtain wavelet transform coefficients.
其中,小波变换是变换分析方法,通过提供一个随频率改变的“时间-频率”窗口,通过变换能够对时间(或空间)频率的局部化分析,通过伸缩平移运算对信号逐步进行多尺度细化,实现高频处时间细分、低频处频率细分,自动适应时频信号分析的要求。可选地,本申请实施例中,对所述第一输入像素进行小波变换时,可通过哈尔离散小波变换方法实现,得到与小波变换系数;可选地,第一输入像素的数值可以是像素的灰度值(或亮度值)。Among them, the wavelet transform is a transformation analysis method. By providing a "time-frequency" window that changes with frequency, the localized analysis of the time (or space) frequency can be performed through the transformation, and the signal can be gradually multi-scale refinement through the scaling and translation operation. , realize time subdivision at high frequency and frequency subdivision at low frequency, and automatically adapt to the requirements of time-frequency signal analysis. Optionally, in the embodiment of the present application, when the first input pixel is subjected to wavelet transform, it can be realized by the Haar discrete wavelet transform method, and the wavelet transform coefficient is obtained; optionally, the value of the first input pixel can be The grayscale value (or luminance value) of the pixel.
分段处理模块603,用于对所述小波变换系数的数值大小进行分频段处理。The segmentation processing module 603 is configured to perform sub-band processing on the numerical value of the wavelet transform coefficient.
得到第一输入像素的小波变换系数后,对小波变换系数依据数值大小分频段处理,比如根据数值大小依次将小波变换系数分成多个频段,比如最低频段、中间频段以及最高频段等After obtaining the wavelet transform coefficient of the first input pixel, the wavelet transform coefficient is divided into frequency bands according to the numerical value, for example, the wavelet transform coefficient is divided into multiple frequency bands according to the numerical value, such as the lowest frequency band, the middle frequency band and the highest frequency band, etc.
编码处理模块604,用于根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散小波变换EZW编码。The encoding processing module 604 is configured to perform discrete wavelet transform EZW encoding on the wavelet transform coefficients according to the frequency band corresponding to each wavelet transform coefficient.
对每个频段,分别进行EZW编码;比如对于最高频段进行第一EZW编码,对于中间频段进行第二EZW编码;对于最低频段进行第三EZW编码,第一EZW编码、第二EZW编码以及第三EZW编码分别独立进行,可采用不同的编码规则,三个编码过程可并行处理,有利于编码端的硬件加速。For each frequency band, EZW encoding is performed separately; for example, the first EZW encoding is performed for the highest frequency band, the second EZW encoding is performed for the middle frequency band; the third EZW encoding is performed for the lowest frequency band, the first EZW encoding, the second EZW encoding and the third EZW encoding EZW encoding is carried out independently, and different encoding rules can be used. The three encoding processes can be processed in parallel, which is beneficial to the hardware acceleration of the encoding end.
可选地,本申请实施例中,所述像素获取模块601包括:Optionally, in this embodiment of the present application, the pixel acquisition module 601 includes:
第一获取子模块,用于在所述第一输入像素的行数为至少两行的情况下,获取电子设备中预先缓存的待编码图像的一行第一输入像素,读取并缓存所述待编码图像的另一行第一输入像素;The first acquisition sub-module is configured to acquire a row of the first input pixels of the to-be-encoded image pre-cached in the electronic device when the number of rows of the first input pixels is at least two, read and cache the to-be-encoded image. another line of the first input pixel of the encoded image;
第二获取子模块,用于在所述第一输入像素的行数为一行的情况下,获取电子设备中预先缓存的待编码图像的一行第一输入像素;a second acquisition sub-module, configured to acquire a row of first input pixels of an image to be encoded pre-cached in the electronic device when the number of rows of the first input pixels is one row;
所述装置还包括:缓存模块,用于在所述第二获取子模块获取待编码图像的第一输入像素之后,读取并缓存所述待编码图像的一行第二输入像素。The apparatus further includes: a buffer module, configured to read and buffer a row of second input pixels of the to-be-coded image after the second acquisition sub-module acquires the first input pixels of the to-be-coded image.
可选地,本申请实施例中,所述小波变换模块602包括:Optionally, in this embodiment of the present application, the wavelet transform module 602 includes:
第一变换子模块,用于对所述第一输入像素进行第一方向的小波变换,得到第一小波变换系数;a first transform submodule, configured to perform wavelet transform in a first direction on the first input pixel to obtain a first wavelet transform coefficient;
第二变换子模块,用于对所述第一小波变换系数进行第二方向的小波变换,得到第二小波变换系数。The second transform sub-module is configured to perform wavelet transform in the second direction on the first wavelet transform coefficients to obtain second wavelet transform coefficients.
可选地,本申请实施例中,所述分段处理模块603用于:Optionally, in this embodiment of the present application, the segmentation processing module 603 is configured to:
根据所述第二小波变换系数的数值大小,由低至高将所述第二小波变换系数分成第一频段、第二频段以及第三频段。According to the numerical value of the second wavelet transform coefficient, the second wavelet transform coefficient is divided into a first frequency band, a second frequency band and a third frequency band from low to high.
可选地,本申请实施例中,所述编码处理模块604包括:Optionally, in this embodiment of the present application, the encoding processing module 604 includes:
重排列子模块,用于根据所述第二小波变换系数的数值大小对所述小波变换系数进行重排列,并填充到重排列表中;所述重排列表中,每个所述频段的所述第二小波变换系数对应不同的目标位置。A rearrangement sub-module, configured to rearrange the wavelet transform coefficients according to the numerical value of the second wavelet transform coefficients, and fill them into a rearrangement list; in the rearrangement list, all the The second wavelet transform coefficients correspond to different target positions.
可选地,本申请实施例中,所述编码处理模块604包括:Optionally, in this embodiment of the present application, the encoding processing module 604 includes:
第二读取子模块,用于从所述重排列表中每个所述目标位置中,读取不同频段的所述第二小波变换系数;a second reading submodule, configured to read the second wavelet transform coefficients of different frequency bands from each of the target positions in the rearrangement list;
编码子模块,用于分别对不同频段的所述第二小波变换系数进行离散小波变换EZW编码。The encoding sub-module is configured to perform discrete wavelet transform EZW encoding on the second wavelet transform coefficients of different frequency bands respectively.
本申请的实施例中,像素获取模块601获取待编码图像的第一输入像素,减少光栅扫描方式输入数据的对行缓存的消耗;小波变换模块602对所述第一输入像素进行小波变换,得到小波变换系数;分段处理模块603对所述小波变换系数的数值大小进行分频段处理;编码处理模块604根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散小波变换EZW编码,不同频段的编码过程独立进行,有利于编码端芯片的硬件加速。In the embodiment of the present application, the pixel obtaining module 601 obtains the first input pixel of the image to be encoded, so as to reduce the consumption of the line buffer of the input data in the raster scanning mode; the wavelet transform module 602 performs wavelet transformation on the first input pixel, and obtains Wavelet transform coefficients; the segmentation processing module 603 performs sub-band processing on the numerical value of the wavelet transform coefficients; the encoding processing module 604 performs discrete wavelet transform EZW on the wavelet transform coefficients according to the frequency band corresponding to each of the wavelet transform coefficients Encoding, the encoding process of different frequency bands is performed independently, which is beneficial to the hardware acceleration of the encoding end chip.
本申请实施例中的图像编码装置可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The image encoding apparatus in this embodiment of the present application may be an apparatus, and may also be a component, an integrated circuit, or a chip in a terminal. The apparatus may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (personal digital assistant). assistant, PDA), etc., non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
本申请实施例中的图像编码装置可以为具有操作***的装置。该操作***可以为安卓(Android)操作***,可以为ios操作***,还可以为其他可能的操作***,本申请实施例不作具体限定。The image encoding apparatus in this embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
本申请实施例提供的图像编码装置能够实现图1至图5的方法实施例 中图像编码装置实现的各个过程,为避免重复,这里不再赘述。The image encoding apparatus provided in the embodiments of the present application can implement each process implemented by the image encoding apparatus in the method embodiments of FIG. 1 to FIG. 5 , and to avoid repetition, details are not described here.
可选的,如图7所示,本申请实施例还提供一种电子设备700,包括处理器701,存储器702,存储在存储器702上并可在所述处理器701上运行的程序或指令,该程序或指令被处理器701执行时实现上述图像编码方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in FIG. 7 , an embodiment of the present application further provides an electronic device 700, including a processor 701, a memory 702, a program or instruction stored in the memory 702 and executable on the processor 701, When the program or instruction is executed by the processor 701, each process of the above-mentioned image coding method embodiments can be realized, and the same technical effect can be achieved. To avoid repetition, details are not described here.
需要注意的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the aforementioned mobile electronic devices and non-mobile electronic devices.
图8为实现本申请各个实施例的一种电子设备800的硬件结构示意图;FIG. 8 is a schematic diagram of a hardware structure of an electronic device 800 implementing various embodiments of the present application;
该电子设备800包括但不限于:射频单元801、网络模块802、音频输出单元803、输入单元804、传感器805、显示单元806、用户输入单元807、接口单元808、存储器809、处理器810、以及电源811等部件。本领域技术人员可以理解,电子设备800还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理***与处理器810逻辑相连,从而通过电源管理***实现管理充电、放电、以及功耗管理等功能。图8中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。The electronic device 800 includes but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, a processor 810, and Power 811 and other components. Those skilled in the art can understand that the electronic device 800 may also include a power supply (such as a battery) for supplying power to various components, and the power supply may be logically connected to the processor 810 through a power management system, so that the power management system can manage charging, discharging, and power management. consumption management and other functions. The structure of the electronic device shown in FIG. 8 does not constitute a limitation on the electronic device. The electronic device may include more or less components than the one shown, or combine some components, or arrange different components, which will not be repeated here. .
其中,处理器810,用于获取待编码图像的第一输入像素;Wherein, the processor 810 is used to obtain the first input pixel of the image to be encoded;
对所述第一输入像素进行小波变换,得到小波变换系数;performing wavelet transform on the first input pixel to obtain wavelet transform coefficients;
对所述小波变换系数的数值大小进行分频段处理;performing sub-band processing on the numerical value of the wavelet transform coefficient;
根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散小波变换EZW编码。According to the frequency band corresponding to each of the wavelet transform coefficients, the discrete wavelet transform EZW coding is performed on the wavelet transform coefficients.
可选地,处理器810用于:Optionally, processor 810 is used to:
在所述第一输入像素的行数为至少两行的情况下,获取电子设备中预先缓存的待编码图像的一行第一输入像素,读取并缓存所述待编码图像的另一行第一输入像素;In the case that the number of lines of the first input pixels is at least two lines, acquire a line of first input pixels of the image to be encoded pre-cached in the electronic device, read and cache another line of the first input pixel of the image to be encoded pixel;
在所述第一输入像素的行数为一行的情况下,获取电子设备中预先缓 存的待编码图像的一行第一输入像素;Under the situation that the row number of the first input pixel is one row, obtain a row of the first input pixel of the image to be encoded that is pre-cached in the electronic device;
可选地,处理器810还用于:读取并缓存所述待编码图像的一行第二输入像素。Optionally, the processor 810 is further configured to: read and cache a row of second input pixels of the to-be-encoded image.
可选地,处理器810用于:Optionally, processor 810 is used to:
对所述第一输入像素进行第一方向的小波变换,得到第一小波变换系数;performing wavelet transformation in a first direction on the first input pixel to obtain a first wavelet transformation coefficient;
对所述第一小波变换系数进行第二方向的小波变换,得到第二小波变换系数。The first wavelet transform coefficients are subjected to wavelet transform in the second direction to obtain second wavelet transform coefficients.
可选地,处理器810用于:Optionally, processor 810 is used to:
根据所述第二小波变换系数的数值大小,由低至高将所述第二小波变换系数分成第一频段、第二频段以及第三频段。According to the numerical value of the second wavelet transform coefficient, the second wavelet transform coefficient is divided into a first frequency band, a second frequency band and a third frequency band from low to high.
可选地,处理器810用于:Optionally, processor 810 is used to:
根据所述第二小波变换系数的数值大小对所述小波变换系数进行重排列,并填充到重排列表中;所述重排列表中,每个所述频段的所述第二小波变换系数对应不同的目标位置。The wavelet transform coefficients are rearranged according to the numerical values of the second wavelet transform coefficients, and are filled into a rearrangement list; in the rearrangement list, the second wavelet transform coefficients of each frequency band correspond to different target locations.
可选地,处理器810用于:Optionally, processor 810 is used to:
从所述重排列表中每个所述目标位置中,读取不同频段的所述第二小波变换系数;From each of the target positions in the rearrangement list, read the second wavelet transform coefficients of different frequency bands;
分别对不同频段的所述第二小波变换系数进行离散小波变换EZW编码。Discrete wavelet transform EZW coding is performed on the second wavelet transform coefficients of different frequency bands respectively.
本申请的实施例中,获取待编码图像的第一输入像素,减少光栅扫描方式输入数据的对行缓存的消耗;对所述第一输入像素进行小波变换,得到小波变换系数;然后对所述小波变换系数的数值大小进行分频段处理;最后根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散小波变换EZW编码,不同频段的编码过程独立进行,有利于编码端芯片的硬件加速。In the embodiment of the present application, the first input pixel of the image to be encoded is obtained to reduce the consumption of the line buffer for the input data in the raster scanning mode; the wavelet transform is performed on the first input pixel to obtain the wavelet transform coefficient; and then the The numerical value of the wavelet transform coefficient is processed by frequency bands; finally, according to the frequency band corresponding to each wavelet transform coefficient, the wavelet transform coefficient is subjected to discrete wavelet transform EZW encoding, and the encoding process of different frequency bands is carried out independently, which is beneficial to the coding end chip. hardware acceleration.
应理解的是,本申请实施例中,输入单元804可以包括图形处理器(Graphics Processing Unit,GPU)8041和麦克风8042,图形处理器8041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的 静态图片或视频的图像数据进行处理。显示单元806可包括显示面板8061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板8061。用户输入单元807包括触控面板8071以及其他输入设备8072。触控面板8071,也称为触摸屏。触控面板8071可包括触摸检测装置和触摸控制器两个部分。其他输入设备8072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。存储器809可用于存储软件程序以及各种数据,包括但不限于应用程序和操作***。处理器810可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作***、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器810中。It should be understood that, in this embodiment of the present application, the input unit 804 may include a graphics processor (Graphics Processing Unit, GPU) 8041 and a microphone 8042. Such as camera) to obtain still pictures or video image data for processing. The display unit 806 may include a display panel 8061, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 807 includes a touch panel 8071 and other input devices 8072 . The touch panel 8071 is also called a touch screen. The touch panel 8071 may include two parts, a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be described herein again. Memory 809 may be used to store software programs as well as various data, including but not limited to application programs and operating systems. The processor 810 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and application programs, and the like, and the modem processor mainly handles wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 810.
本申请实施例还提供一种电子设备,被配置成用于执行上述图像编码方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application further provide an electronic device, which is configured to execute each process of the above image coding method embodiments, and can achieve the same technical effect. To avoid repetition, details are not described here.
本申请实施例还提供一种可读存储介质,可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述图像编码方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application further provide a readable storage medium, where a program or an instruction is stored on the readable storage medium. When the program or instruction is executed by a processor, each process of the above image encoding method embodiment can be implemented, and the same technology can be achieved. The effect, in order to avoid repetition, is not repeated here.
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,计算机可读存储介质的示例包括非暂态计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the foregoing embodiments. The readable storage medium includes a computer-readable storage medium, and examples of the computer-readable storage medium include non-transitory computer-readable storage media, such as computer read-only memory (Read-Only Memory, ROM), random access memory ( Random Access Memory, RAM), disk or CD, etc.
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述图像编码方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement the above image encoding method embodiments. Each process can achieve the same technical effect. In order to avoid repetition, it will not be repeated here.
应理解,本申请实施例提到的芯片还可以称为***级芯片、***芯片、芯片***或片上***芯片等。It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip, a system-on-a-chip, or a system-on-a-chip, or the like.
本发明实施例还提供一种计算机程序产品,所述计算机程序产品可被 处理器执行以实现上述图像编码方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present invention further provide a computer program product, which can be executed by a processor to implement the various processes of the above image coding method embodiments, and can achieve the same technical effect. To avoid repetition, details are not repeated here. .
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in the reverse order depending on the functions involved. To perform functions, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to some examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course hardware can also be used, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of this application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the inspiration of this application, without departing from the scope of protection of the purpose of this application and the claims, many forms can be made, which all fall within the protection of this application.

Claims (15)

  1. 一种图像编码方法,包括:An image encoding method, comprising:
    获取待编码图像的第一输入像素;obtaining the first input pixel of the image to be encoded;
    对所述第一输入像素进行小波变换,得到小波变换系数;performing wavelet transform on the first input pixel to obtain wavelet transform coefficients;
    对所述小波变换系数的数值大小进行分频段处理;performing sub-band processing on the numerical value of the wavelet transform coefficient;
    根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散小波变换EZW编码。According to the frequency band corresponding to each of the wavelet transform coefficients, the discrete wavelet transform EZW coding is performed on the wavelet transform coefficients.
  2. 根据权利要求1所述的图像编码方法,其中,The image coding method according to claim 1, wherein,
    在所述第一输入像素的行数为至少两行的情况下,所述获取待编码图像的第一输入像素,包括:When the number of lines of the first input pixels is at least two lines, the acquiring the first input pixels of the image to be encoded includes:
    获取电子设备中预先缓存的待编码图像的一行第一输入像素,读取并缓存所述待编码图像的其他行第一输入像素;Obtaining the first input pixels of a row of the image to be encoded pre-cached in the electronic device, and reading and buffering the first input pixels of other rows of the image to be encoded;
    在所述第一输入像素的行数为一行的情况下,所述获取待编码图像的第一输入像素,包括:When the number of lines of the first input pixel is one line, the acquiring the first input pixel of the image to be encoded includes:
    获取电子设备中预先缓存的待编码图像的一行第一输入像素;所述获取待编码图像的第一输入像素之后,所述方法包括:读取并缓存所述待编码图像的一行第二输入像素。Obtaining a row of first input pixels of an image to be encoded pre-cached in the electronic device; after acquiring the first input pixels of the image to be encoded, the method includes: reading and buffering a row of second input pixels of the image to be encoded .
  3. 根据权利要求1所述的图像编码方法,其中,所述对所述第一输入像素进行小波变换,得到小波变换系数,包括:The image encoding method according to claim 1, wherein the performing wavelet transform on the first input pixel to obtain wavelet transform coefficients comprises:
    对所述第一输入像素进行第一方向的小波变换,得到第一小波变换系数;performing wavelet transformation in a first direction on the first input pixel to obtain a first wavelet transformation coefficient;
    对所述第一小波变换系数进行第二方向的小波变换,得到第二小波变换系数。The first wavelet transform coefficients are subjected to wavelet transform in the second direction to obtain second wavelet transform coefficients.
  4. 根据权利要求3所述的图像编码方法,其中,所述对所述小波变换系数的数值大小进行分频段处理,包括:The image coding method according to claim 3, wherein said performing sub-band processing on the numerical value of the wavelet transform coefficient comprises:
    根据所述第二小波变换系数的数值大小,由低至高将所述第二小波变换系数分成第一频段、第二频段以及第三频段。According to the numerical value of the second wavelet transform coefficient, the second wavelet transform coefficient is divided into a first frequency band, a second frequency band and a third frequency band from low to high.
  5. 根据权利要求4所述的图像编码方法,其中,所述根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散小波变换EZW编码,包括:The image coding method according to claim 4, wherein the performing discrete wavelet transform EZW coding on the wavelet transform coefficients according to the frequency band corresponding to each of the wavelet transform coefficients comprises:
    根据所述第二小波变换系数的数值大小对所述小波变换系数进行重排列,并填充到重排列表中;所述重排列表中,每个所述频段的所述第二小波变换系数对应不同的目标位置。The wavelet transform coefficients are rearranged according to the numerical values of the second wavelet transform coefficients, and are filled into a rearrangement list; in the rearrangement list, the second wavelet transform coefficients of each frequency band correspond to different target locations.
  6. 一种图像编码装置,包括:An image encoding device, comprising:
    像素获取模块,用于获取待编码图像的第一输入像素;a pixel acquisition module for acquiring the first input pixel of the image to be encoded;
    小波变换模块,用于对所述第一输入像素进行小波变换,得到小波变换系数;a wavelet transform module, configured to perform wavelet transform on the first input pixel to obtain wavelet transform coefficients;
    分段处理模块,用于对所述小波变换系数的数值大小进行分频段处理;a segmentation processing module, configured to perform sub-band processing on the numerical value of the wavelet transform coefficient;
    编码处理模块,用于根据每个所述小波变换系数对应的频段,对所述小波变换系数进行离散小波变换EZW编码。The encoding processing module is configured to perform discrete wavelet transform EZW encoding on the wavelet transform coefficients according to the frequency band corresponding to each wavelet transform coefficient.
  7. 根据权利要求6所述的图像编码装置,其中,所述像素获取模块包括:The image encoding device according to claim 6, wherein the pixel acquisition module comprises:
    第一获取子模块,用于在所述第一输入像素的行数为至少两行的情况下,获取电子设备中预先缓存的待编码图像的一行第一输入像素,读取并缓存所述待编码图像的其他行第一输入像素;The first acquisition sub-module is configured to acquire a row of the first input pixels of the to-be-encoded image pre-cached in the electronic device when the number of rows of the first input pixels is at least two, read and cache the to-be-encoded image. the first input pixel of the other lines of the encoded image;
    第二获取子模块,用于在所述第一输入像素的行数为一行的情况下,获取电子设备中预先缓存的待编码图像的一行第一输入像素;a second acquisition sub-module, configured to acquire a row of first input pixels of an image to be encoded pre-cached in the electronic device when the number of rows of the first input pixels is one row;
    所述装置还包括:缓存模块,用于在所述第二获取子模块获取待编码图像的第一输入像素之后,读取并缓存所述待编码图像的一行第二输入像素。The apparatus further includes: a buffer module, configured to read and buffer a row of second input pixels of the to-be-coded image after the second acquisition sub-module acquires the first input pixels of the to-be-coded image.
  8. 根据权利要求6所述的图像编码装置,其中,所述小波变换模块包括:The image encoding apparatus according to claim 6, wherein the wavelet transform module comprises:
    第一变换子模块,用于对所述第一输入像素进行第一方向的小波变换,得到第一小波变换系数;a first transform submodule, configured to perform wavelet transform in a first direction on the first input pixel to obtain a first wavelet transform coefficient;
    第二变换子模块,用于对所述第一小波变换系数进行第二方向的小波变换,得到第二小波变换系数。The second transform sub-module is configured to perform wavelet transform in the second direction on the first wavelet transform coefficients to obtain second wavelet transform coefficients.
  9. 根据权利要求8所述的图像编码装置,其中,所述分段处理模块用于:The image encoding apparatus according to claim 8, wherein the segment processing module is used for:
    根据所述第二小波变换系数的数值大小,由低至高将所述第二小波变换系数分成第一频段、第二频段以及第三频段。According to the numerical value of the second wavelet transform coefficient, the second wavelet transform coefficient is divided into a first frequency band, a second frequency band and a third frequency band from low to high.
  10. 根据权利要求9所述的图像编码装置,其中,所述编码处理模块包括:The image encoding device according to claim 9, wherein the encoding processing module comprises:
    重排列子模块,用于根据所述第二小波变换系数的数值大小对所述小波变换系数进行重排列,并填充到重排列表中;所述重排列表中,每个所述频段的所述第二小波变换系数对应不同的目标位置。A rearrangement sub-module, configured to rearrange the wavelet transform coefficients according to the numerical value of the second wavelet transform coefficients, and fill them into a rearrangement list; in the rearrangement list, all the The second wavelet transform coefficients correspond to different target positions.
  11. 一种电子设备,包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1至5中任一项所述的图像编码方法的步骤。An electronic device, comprising a processor, a memory, and a program or instruction stored on the memory and executable on the processor, the program or instruction being executed by the processor to achieve as claimed in claims 1 to 5 The steps of any one of the image coding methods.
  12. 一种电子设备,被配置为用于执行如权利要求1至5中任一项所述的图像编码方法的步骤。An electronic device configured to perform the steps of the image encoding method of any one of claims 1 to 5.
  13. 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1至5中任一项所述的图像编码方法的步骤。A readable storage medium on which programs or instructions are stored, and when the programs or instructions are executed by a processor, implement the steps of the image encoding method according to any one of claims 1 to 5.
  14. 一种计算机程序产品,所述计算机程序产品可被处理器执行以实现如权利要求1至5中任一项所述的图像编码方法的步骤。A computer program product executable by a processor to implement the steps of the image encoding method of any one of claims 1 to 5.
  15. 一种芯片,包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1至5中任一项所述的图像编码方法的步骤。A chip, comprising a processor and a communication interface, wherein the communication interface is coupled with the processor, and the processor is used to run a program or an instruction to implement the image coding method according to any one of claims 1 to 5. step.
PCT/CN2021/137657 2020-12-21 2021-12-14 Image encoding method and apparatus WO2022135218A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011524412.7A CN112637607A (en) 2020-12-21 2020-12-21 Image coding method and device
CN202011524412.7 2020-12-21

Publications (1)

Publication Number Publication Date
WO2022135218A1 true WO2022135218A1 (en) 2022-06-30

Family

ID=75320574

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/137657 WO2022135218A1 (en) 2020-12-21 2021-12-14 Image encoding method and apparatus

Country Status (2)

Country Link
CN (1) CN112637607A (en)
WO (1) WO2022135218A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637607A (en) * 2020-12-21 2021-04-09 维沃移动通信有限公司 Image coding method and device
CN114143557B (en) * 2021-12-24 2023-07-07 成都索贝数码科技股份有限公司 Low-complexity coding method for wavelet transformation high-frequency coefficient of video image

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101132529A (en) * 2006-08-22 2008-02-27 中兴通讯股份有限公司 Wavelet image compression method based on fast and successive approximation to quantification
CN104079947A (en) * 2014-06-25 2014-10-01 武汉大学 Sonar image data compression method based on improved EZW
CN106709891A (en) * 2016-11-15 2017-05-24 哈尔滨理工大学 Image processing method based on combination of wavelet transform and self-adaptive transform
CN112637607A (en) * 2020-12-21 2021-04-09 维沃移动通信有限公司 Image coding method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100480600B1 (en) * 2002-06-12 2005-04-06 삼성전자주식회사 Method and apparatus based on grouped zero tree wavelet image coding algorithm
CN1642278A (en) * 2004-01-06 2005-07-20 北京大学 Embedded type zero-type encoding method and circuit structure thereof
JP2019110405A (en) * 2017-12-15 2019-07-04 キヤノン株式会社 Image coding device, control method of the same, and program
CN109803148B (en) * 2019-03-13 2020-09-22 苏州泓迅生物科技股份有限公司 Image coding method, decoding method, coding device and decoding device
CN111211787A (en) * 2019-10-09 2020-05-29 华中科技大学 Industrial data compression method, system, storage medium and terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101132529A (en) * 2006-08-22 2008-02-27 中兴通讯股份有限公司 Wavelet image compression method based on fast and successive approximation to quantification
CN104079947A (en) * 2014-06-25 2014-10-01 武汉大学 Sonar image data compression method based on improved EZW
CN106709891A (en) * 2016-11-15 2017-05-24 哈尔滨理工大学 Image processing method based on combination of wavelet transform and self-adaptive transform
CN112637607A (en) * 2020-12-21 2021-04-09 维沃移动通信有限公司 Image coding method and device

Also Published As

Publication number Publication date
CN112637607A (en) 2021-04-09

Similar Documents

Publication Publication Date Title
WO2022135218A1 (en) Image encoding method and apparatus
JP3922919B2 (en) Still image expansion apparatus and still image expansion method
WO2020150942A1 (en) Method and device for encoding and decoding images
JP2004221836A (en) Image processor, program, storage medium, and code expanding method
Chew et al. Low–memory video compression architecture using strip–based processing for implementation in wireless multimedia sensor networks
JP4179498B2 (en) Image processing apparatus and image processing method
JP3952459B2 (en) Image processing apparatus, program, storage medium, and image processing method
CN110278443B (en) Context modeling method and device for dividing zone bits
CN105392014B (en) A kind of wavelet-transform image compression method of optimization
WO2021168827A1 (en) Image transmission method and apparatus
WO2020168501A1 (en) Image encoding method and decoding method, and device and system to which said methods are applicable
WO2019174567A1 (en) Context modelling method and device for partition flag bit
CN113810717B (en) Image processing method and device
JP4723543B2 (en) Image processing apparatus, image processing method, program, and storage medium
CN110710219B (en) Method and apparatus for context derivation for coefficient coding
JP4124436B2 (en) Motion estimation device, program, storage medium, and motion estimation method
JP4014085B2 (en) Image processing apparatus, program, and storage medium
WO2022120829A1 (en) Image encoding and decoding methods and apparatuses, and image processing apparatus and mobile platform
US20080181518A1 (en) Method and Apparatus for Fast and Flexible Digital Image Compression Using Programmable Sprite Buffer
CN116132759B (en) Audio and video stream synchronous transmission method and device, electronic equipment and storage medium
Balaji et al. Spatial domain image packet prioritization for energy-constrained wireless communications
Pandey et al. Hybrid image compression based on fuzzy logic technology
US20240129487A1 (en) Keypoints based video compression
JP4010957B2 (en) Image processing apparatus, program, storage medium, and image forming apparatus
Wenna et al. Medical image coding based on wavelet transform and distributed arithmetic coding

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21909215

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21909215

Country of ref document: EP

Kind code of ref document: A1