CN116962693A - Image processing method, device, electronic equipment and readable storage medium - Google Patents

Image processing method, device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN116962693A
CN116962693A CN202310957147.9A CN202310957147A CN116962693A CN 116962693 A CN116962693 A CN 116962693A CN 202310957147 A CN202310957147 A CN 202310957147A CN 116962693 A CN116962693 A CN 116962693A
Authority
CN
China
Prior art keywords
data
image data
image
encoding
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310957147.9A
Other languages
Chinese (zh)
Inventor
叶巧玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202310957147.9A priority Critical patent/CN116962693A/en
Publication of CN116962693A publication Critical patent/CN116962693A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • H04N19/122Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • 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

Landscapes

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

Abstract

The application discloses an image processing method, an image processing device, electronic equipment and a readable storage medium, and belongs to the technical field of electronics. The method comprises the following steps: acquiring the data quantity and the data value of the image data of each pixel point in the first image block, wherein the data quantity of the image data of each pixel point is the same; selecting a target coding mode from N preset coding modes based on a first data value, wherein the first data value is the data value of the image data of a first pixel point, and the first pixel point is the pixel point with the maximum data value of the image data in the first image block; and adopting a target coding mode to code and compress the first image block to obtain target data.

Description

Image processing method, device, electronic equipment and readable storage medium
Technical Field
The application belongs to the field of image processing, and particularly relates to an image processing method, an image processing device, electronic equipment and a readable storage medium.
Background
With the rapid development of digital information technology, the huge amount of data generated after image digitization will put pressure on data transmission. In order to adapt to the development of the multimedia field and meet the requirement of higher-speed image transmission, the data stream is usually selected to be simplified under the condition of limited network bandwidth, namely, the image is compressed. The lossless compression mode can ensure that the image does not lose any data information, and completely restores the initial content of the image when the image is decompressed, and is widely applied to the field of image transmission.
In the related art, an electronic device typically losslessly compresses image data within a specific range using a 3-based bounded integer sequence encoding (Bounded Integer Sequence Encoding, BISE) image lossless compression scheme or a 5-based BISE image lossless compression scheme. Since this approach requires combining the information within the image blocks into multiple sets of binary integer sequences, the 3-based BISE image lossless compression approach is only applicable to image data with data values less than 3×2 n-2 In the case of (2), the 5-based BISE image lossless compression scheme is applicable only to image data having a data value of less than 5×2 n-3 Is the case in (a).
Thus, when the two modes are used for lossless compression of the image, the application range is small, the data compression rate is high, and data loss is easy to cause.
Disclosure of Invention
An object of an embodiment of the present application is to provide an image processing method, an apparatus, an electronic device, and a readable storage medium, which can increase an application range of lossless compression of an image, and reduce a data compression rate, thereby improving a data transmission rate.
In a first aspect, an embodiment of the present application provides an image processing method, including: acquiring the data quantity and the data value of the image data of each pixel point in the first image block, wherein the data quantity of the image data of each pixel point is the same; selecting a target coding mode from N preset coding modes based on a first data value, wherein the first data value is the data value of the image data of a first pixel point, and the first pixel point is the pixel point with the maximum data value of the image data in a first image block; encoding and compressing the first image block by adopting a target encoding mode to obtain target data; the N preset coding modes comprise at least one of the following: a first coding scheme, a second coding scheme, a third coding scheme, a fourth coding scheme, a fifth coding scheme, and a sixth coding scheme; image data of pixel point encoded and compressed by adopting first encoding mode The maximum value of the data values of (2) is greater than or equal to 13 x 2 n-4 And less than 7 x 2 n-3 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the second encoding mode is less than 9 multiplied by 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the third encoding mode is more than or equal to 5 multiplied by 2 n-3 And less than 11 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the fourth encoding mode is more than or equal to 3 multiplied by 2 n-2 And is less than 13 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixels subjected to the encoding compression by the fifth encoding method is larger than or equal to 11×2 n -4 And less than 3 x 2 n-2 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by the sixth encoding mode is more than or equal to 9 multiplied by 2 n-4 And less than 5 x 2 n-3 N is the data amount of the image data of the pixel point subjected to the encoding compression.
In a second aspect, an embodiment of the present application provides an image processing apparatus including: the device comprises an acquisition module, a determination module and a processing module; the acquisition module is used for acquiring the data quantity and the data value of the image data of each pixel point in the first image block, wherein the data quantity of the image data of each pixel point is the same; the determining module is configured to select a target encoding mode from N preset encoding modes based on a first data value, where the first data value is a data value of image data of a first pixel, and the first pixel is a pixel with a maximum data value of image data in a first image block; the processing module is used for carrying out encoding compression on the first image block by adopting a target encoding mode to obtain target data; wherein, the N preset coding modes comprise at least one of the following: a first coding scheme, a second coding scheme, a third coding scheme, a fourth coding scheme, a fifth coding scheme, and a sixth coding scheme; the maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the first encoding mode is larger than or equal to 13 multiplied by 2 n-4 And less than 7 x 2 n-3 The method comprises the steps of carrying out a first treatment on the surface of the Picture of pixel point encoded and compressed by adopting second encoding modeThe maximum value of the data values of the image data is less than 9×2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the third encoding mode is more than or equal to 5 multiplied by 2 n-3 And less than 11 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the fourth encoding mode is more than or equal to 3 multiplied by 2 n-2 And is less than 13 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixels subjected to the encoding compression by the fifth encoding method is larger than or equal to 11×2 n-4 And less than 3 x 2 n-2 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by the sixth encoding mode is more than or equal to 9 multiplied by 2 n-4 And less than 5 x 2 n-3 N is the data amount of the image data of the pixel point subjected to the encoding compression.
In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method as described in the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor perform the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and where the processor is configured to execute a program or instructions to implement a method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product stored in a storage medium, the program product being executable by at least one processor to implement the method according to the first aspect.
In the embodiment of the application, the electronic equipment acquires the data volume and the data value of the image data of each pixel point in the first image block, and the data volume of the image data of each pixel point is the same; base groupSelecting a target coding mode from N preset coding modes from a first data value, wherein the first data value is the data value of the image data of a first pixel point, and the first pixel point is the pixel point with the maximum data value of the image data in a first image block; encoding and compressing the first image block by adopting a target encoding mode to obtain target data; wherein, the N preset coding modes comprise at least one of the following: a first coding scheme, a second coding scheme, a third coding scheme, a fourth coding scheme, a fifth coding scheme, and a sixth coding scheme; the maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the first encoding mode is larger than or equal to 13 multiplied by 2 n-4 And less than 7 x 2 n-3 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the second encoding mode is less than 9 multiplied by 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the third encoding mode is more than or equal to 5 multiplied by 2 n -3 And less than 11 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the fourth encoding mode is more than or equal to 3 multiplied by 2 n-2 And is less than 13 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixels subjected to the encoding compression by the fifth encoding method is larger than or equal to 11×2 n-4 And less than 3 x 2 n-2 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by the sixth encoding mode is more than or equal to 9 multiplied by 2 n-4 And less than 5 x 2 n-3 N is the data amount of the image data of the pixel point subjected to the encoding compression. In this way, the value range of the image data value of the pixel point subjected to coding compression is widened by adding N preset coding modes, so that the electronic equipment can perform lossless compression on more images; meanwhile, the electronic equipment can flexibly select a target coding mode with smaller data compression rate according to the maximum data values of different image data, so that the compression rate of the image data is reduced.
Drawings
FIG. 1 is a schematic flow chart of an image processing method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an example of determining a target encoding mode according to an embodiment of the present application;
fig. 3 is a schematic diagram of grouping pixel points in image data in an image processing method according to an embodiment of the present application;
FIG. 4 is a second flowchart of an image processing method according to an embodiment of the present application;
FIG. 5 is a third flowchart of an image processing method according to an embodiment of the present application;
fig. 6 is a schematic diagram of an image compression process and a decompression process in an image processing method according to an embodiment of the present application;
FIG. 7 is a flowchart of an image processing method according to an embodiment of the present application;
fig. 8 is a schematic diagram of an image processing apparatus according to an embodiment of the present application;
FIG. 9 is a second schematic diagram of an image processing apparatus according to an embodiment of the present application;
FIG. 10 is a third schematic diagram of an image processing apparatus according to an embodiment of the present application;
fig. 11 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application;
fig. 12 is a second schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are obtained by a person skilled in the art based on the embodiments of the present application, fall within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The terms "at least one," "at least one," and the like in the description and in the claims, mean that they encompass any one, any two, or a combination of two or more of the objects. For example, at least one of a, b, c (item) may represent: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", wherein a, b, c may be single or plural. Similarly, the term "at least two" means two or more, and the meaning of the expression is similar to the term "at least one".
The image processing method, the device, the electronic equipment and the readable storage medium provided by the embodiment of the application are described in detail below through specific embodiments and application scenes thereof with reference to the accompanying drawings.
With the rapid development of digital information technology, the huge amount of data generated after image digitization will put pressure on data transmission. In order to adapt to the development of the multimedia field and meet the requirement of higher-speed image transmission, the data stream is usually selected to be simplified under the condition of limited network bandwidth, namely, the image is compressed. The compressed image can improve the data transmission bandwidth to a certain extent, when transmitting the content containing important information such as fingerprints, the image compression and image decompression processes need to be completed as high as possible, and the lossless compression mode can ensure that the image does not lose any data information and completely restore the initial content of the image, so that the image lossless compression mode is widely applied to the field of special image transmission.
In the related art, an electronic device generally adopts a 3-based BISE image lossless compression mode, hereinafter referred to as BISE3, orAnd (3) performing lossless compression on the image data in a specific range based on a BISE image lossless compression mode of 5, hereinafter referred to as BISE 5. Since this approach requires combining the information within the image blocks into multiple sets of binary integer sequences, the 3-based BISE image lossless compression approach is only applicable to image data with data values less than 3×2 n-2 In the case of (2), the 5-based BISE image lossless compression scheme is applicable only to image data having a data value of less than 5×2 n-3 Is the case in (a). For example, for a 4x4 tile of 4 bits wide, using BISE3, the application scope [0,11 ]]The data compression rate is 90.63%; application Range [0,9 ] with BISE5]The data compression rate was 84.38%.
Thus, when the two modes are used for lossless compression of the image, the application range is small, the data compression rate is high, and data loss is easy to cause.
In the embodiment of the application, the electronic equipment acquires the data volume and the data value of the image data of each pixel point in the first image block, and the data volume of the image data of each pixel point is the same; selecting a target coding mode from N preset coding modes based on a first data value, wherein the first data value is the data value of the image data of a first pixel point, and the first pixel point is the pixel point with the maximum data value of the image data in a first image block; encoding and compressing the first image block by adopting a target encoding mode to obtain target data; wherein, the N preset coding modes comprise at least one of the following: a first coding scheme, a second coding scheme, a third coding scheme, a fourth coding scheme, a fifth coding scheme, and a sixth coding scheme; the maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the first encoding mode is larger than or equal to 13 multiplied by 2 n-4 And less than 7 x 2 n-3 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the second encoding mode is less than 9 multiplied by 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the third encoding mode is more than or equal to 5 multiplied by 2 n -3 And less than 11 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the Maximum of data values of image data of pixels subjected to encoding compression by the fourth encoding methodA value greater than or equal to 3X 2 n-2 And is less than 13 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixels subjected to the encoding compression by the fifth encoding method is larger than or equal to 11×2 n-4 And less than 3 x 2 n-2 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by the sixth encoding mode is more than or equal to 9 multiplied by 2 n-4 And less than 5 x 2 n-3 N is the data amount of the image data of the pixel point subjected to the encoding compression. In this way, the value range of the image data value of the pixel point subjected to coding compression is widened by adding N preset coding modes, so that the electronic equipment can perform lossless compression on more images; meanwhile, the electronic equipment can flexibly select a target coding mode with smaller data compression rate according to the maximum data values of different image data, so that the compression rate of the image data is reduced.
The main execution body of the image processing method provided in this embodiment may be an image processing apparatus, and the image processing apparatus may be an electronic device, or may be a control module or a processing module in the electronic device. The technical solution provided by the embodiment of the present application is described below by taking an electronic device as an example.
An embodiment of the present application provides an image processing method, and fig. 1 shows a flowchart of the image processing method provided by the embodiment of the present application, where the method may be applied to an electronic device. As shown in fig. 1, the image processing method provided by the embodiment of the present application may include the following steps 201 to 203.
Step 201, the electronic device obtains the data amount and the data of the image data of each pixel point in the first image block.
In the embodiment of the present application, the first image block may be a 4×4 image block, and each image block corresponds to one pixel, that is, the 4×4 image block includes 16 pixels.
In the embodiment of the present application, the image data is used to represent various data of each pixel point in the first image block, for example, R, G, or B three color channels.
In the embodiment of the present application, for the image data of one pixel in the first image block, the data amount is used to represent the data size of the pixel, for example, the data amount of the image data of the R channel of the pixel is 4 bits.
In the embodiment of the present application, the data amount of the image data of each pixel is the same.
In an embodiment of the present application, for the image data of a pixel in the first image block, the data value is used to represent the numerical value of the data of the pixel, for example, the data value of the image data of the R channel of the pixel is 245.
Taking the first image block as a 4×4 image block as an example, the electronic device reads the image data of the 4×4 image block, and assuming that the data amount of one pixel is n bits, since the data amount of each pixel in the 4×4 image block is the same, the electronic device reads the data amount of 16n bits, that is, the total data amount of the image data of 16 pixels, and the data value of each pixel.
Step 202, the electronic device selects a target coding mode from N preset coding modes based on the first data value.
In the embodiment of the present application, the first data value is a data value of image data of each first pixel point.
In the embodiment of the present application, the first pixel is a pixel with a maximum data value of the image data in the first image block.
In the embodiment of the application, the electronic device compares the data values of the image data of each pixel point to finally obtain the maximum value of the data values, namely the first data value.
Taking the first image block as a 4×4 image block as an example, the electronic device may compare the data values of the image data of each two adjacent pixels to obtain the data values of the image data of 8 pixels for 8 times, then compare the data values of the image data of 8 pixels to obtain the data values of the image data of 4 pixels for 4 times, then compare the data values of the image data of 4 pixels to obtain the data values of the image data of 2 pixels for 2 times, and finally compare the data values of the image data of the remaining 2 pixels to obtain the maximum value, i.e. the first data value.
In the embodiment of the present application, the electronic device selects, according to the first data value, a target coding mode that conforms to the first data value range from preset coding modes.
In the embodiment of the present application, the N preset encoding modes include at least one of the following: the first coding scheme, the second coding scheme, the third coding scheme, the fourth coding scheme, the fifth coding scheme, and the sixth coding scheme.
The encoding methods used in the first to sixth encoding methods may be, for example, a BISE lossless compression method, a huffman compression encoding method, or a fractal image compression method. The present application is described by taking a lossless compression method of BISE as an example.
In the embodiment of the present application, the image data value of the pixel point encoded and compressed by the first encoding method is greater than or equal to 13×2 n-4 And less than 7 x 2 n-3 Hereinafter, BISE7.
In the embodiment of the present application, the image data value of the pixel point encoded and compressed by the second encoding method is smaller than 9×2 n-4 Hereinafter, BISE9.
In the embodiment of the present application, the image data value of the pixel point encoded and compressed by the third encoding method is greater than or equal to 5×2 n-3 And less than 11 x 2 n-4 Hereinafter, BISE11.
In the embodiment of the present application, the image data value of the pixel point encoded and compressed by the fourth encoding method is greater than or equal to 3×2 n-2 And is less than 13 x 2 n-4 Hereinafter, BISE13.
In the embodiment of the present application, the image data value of the pixel point encoded and compressed by the fifth encoding method is greater than or equal to 11×2 n-4 And less than 3 x 2 n-2 Hereinafter, BISE3.
In the embodiment of the applicationThe image data value of the pixel point subjected to the encoding compression by adopting the sixth encoding mode is larger than or equal to 9 multiplied by 2 n-4 And less than 5 x 2 n-3 Hereinafter, BISE5.
Where n is the data amount of the image data of the pixel point subjected to encoding compression.
In the embodiment of the present application, the target coding scheme may be at least one of the first coding scheme to the sixth coding scheme.
Optionally, in an embodiment of the present application, the step 202 includes the following steps 202a to 202f:
step 202a, wherein the first data value is less than 9×2 n-4 In the case of (2), the electronic device uses the second encoding scheme as the target encoding scheme.
Step 202b, wherein the first data value is greater than or equal to 9×2 n-4 And less than 5 x 2 n-3 In the case of (2), the electronic device uses the sixth coding scheme as the target coding scheme.
Step 202c, wherein the first data value is greater than or equal to 5×2 n-3 And less than 11 x 2 n-4 In the case of (2), the electronic device uses the third encoding scheme as the target encoding scheme.
Step 202d, wherein the first data value is greater than or equal to 11×2 n-4 And less than 3 x 2 n-2 In the case of (2), the electronic device uses the fifth encoding scheme as the target encoding scheme.
Step 202e, wherein the first data value is greater than or equal to 3×2 n-2 And is less than 13 x 2 n-4 In the case of (2), the electronic device uses the fourth coding scheme as the target coding scheme.
Step 202f: the first data value is greater than or equal to 13×2 n-4 And less than 7 x 2 n-3 In the case of (2), the electronic device uses the first encoding scheme as the target encoding scheme.
Further optionally, in an embodiment of the present application, in combination with the step 202a to the step 202f, the image processing method provided in the embodiment of the present application further includes a step 202g:
step 202g, wherein the first data value is greater than 7×2 n-3 In the event that the electronic device determines not to code compress the first image block.
The following describes, in one possible embodiment, a determination process for determining a target coding manner by an electronic device. As shown in fig. 2, specifically, steps A1 to A6 are included.
Step A1: the electronic device determines whether the maximum value max, i.e. the first data value is less than 3×2 n-2 If the difference is smaller than the preset threshold, the step A2 is executed, and otherwise the step A5 is executed.
Step A2, the electronic device judges whether the maximum value max is less than 5 multiplied by 2 n-3 If the difference is smaller than the preset threshold, the step A3 is executed, and otherwise the step A4 is executed.
Step A3, the electronic device judges whether the maximum value max is less than 9 multiplied by 2 n-4 If the image compression mode is smaller than the BISE9 image compression mode, otherwise, the BISE5 image compression mode is adopted.
Step A4, the electronic equipment judges whether the maximum value max is smaller than 11 multiplied by 2 n-4 If the compression mode is smaller than the compression mode, the BISE11 compression mode is adopted, otherwise, the image compression mode of BISE3 is adopted.
Step A5, the electronic device judges whether the maximum value max is less than 7 multiplied by 2 n-3 If the data is smaller than the predetermined value, the step A6 is executed, otherwise, the data is not compressed, and then the identifier is added before the image data.
Step A6, the electronic device judges whether the maximum value max is smaller than 13 multiplied by 2 n-4 If the image compression mode is smaller than the BISE13, the image compression mode of BISE7 is adopted.
Therefore, the electronic device can determine the target coding mode most suitable for the current image block by judging the maximum data value in the image block due to different applicable ranges of different coding modes, so that the electronic device can flexibly select the coding mode with smaller image compression rate according to the data value of the image data of the actual image block, and the image compression rate is reduced.
And 203, the electronic equipment adopts a target coding mode to carry out coding compression on the first image block to obtain target data.
In the embodiment of the present application, the target data may be binary data.
In the embodiment of the application, the electronic device groups each pixel point in the first image block based on the group element number corresponding to the target coding mode, and performs coding compression processing on the image data of each group of pixel points according to the groups, so as to finally obtain the coded and compressed data, namely the target data.
In the image processing method provided by the embodiment of the application, the electronic equipment acquires the data volume and the data value of the image data of each pixel point in the first image block, and the data volume of the image data of each pixel point is the same; selecting a target coding mode from N preset coding modes based on a first data value, wherein the first data value is the data value of the image data of a first pixel point, and the first pixel point is the pixel point with the maximum data value of the image data in a first image block; encoding and compressing the first image block by adopting a target encoding mode to obtain target data; the N preset coding modes comprise at least one of the following: a first coding scheme, a second coding scheme, a third coding scheme, a fourth coding scheme, a fifth coding scheme, and a sixth coding scheme; the maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the first encoding mode is larger than or equal to 13 multiplied by 2 n-4 And less than 7 x 2 n-3 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the second encoding mode is less than 9 multiplied by 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the third encoding mode is more than or equal to 5 multiplied by 2 n-3 And less than 11 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the fourth encoding mode is more than or equal to 3 multiplied by 2 n-2 And is less than 13 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixels subjected to the encoding compression by the fifth encoding method is larger than or equal to 11×2 n-4 And less than 3 x 2 n-2 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixels subjected to the encoding compression by the sixth encoding method is greater than or equal toAt 9X 2 n-4 And less than 5 x 2 n-3 N is the data amount of the image data of the pixel point subjected to the encoding compression. In this way, the value range of the image data value of the pixel point subjected to coding compression is widened by adding N preset coding modes, so that the electronic equipment can perform lossless compression on more images; meanwhile, the electronic equipment can flexibly select a target coding mode with smaller data compression rate according to the maximum data values of different image data, so that the compression rate of the image data is reduced.
Optionally, in an embodiment of the present application, the step 203 includes the following steps 203a and 203b:
in step 203a, the electronic device groups the image data of all the pixel points in the first image block according to the group element number M corresponding to the target encoding mode.
In the embodiment of the present application, each set of image data includes image data of M pixels.
In the embodiment of the present application, the number M of group elements corresponding to the first encoding mode is 6; the number M of group elements corresponding to the second coding mode and the fourth coding mode is 4; the number M of group elements corresponding to the third coding mode is 2; the number M of group elements corresponding to the fifth coding mode is 5; the number M of group elements corresponding to the sixth coding scheme is 3.
Taking the first image block as a 4×4 image block as an example, in the case of encoding and compressing the first image block by using BISE3, the pixels of the first image block are divided into 3 groups by 5 pixels per group; under the condition that BISE5 is adopted to carry out coding compression on the first image block, dividing the pixels of the first image block into 5 groups according to 3 pixels of each group; under the condition that BISE7 is adopted to carry out coding compression on the first image block, dividing the pixels of the first image block into 2 groups according to 6 pixels of each group; under the condition that BISE9 is adopted to carry out coding compression on the first image block, dividing the pixels of the first image block into 4 groups according to 4 pixels of each group; under the condition that BISE11 is adopted to carry out coding compression on the first image block, dividing the pixels of the first image block into 8 groups according to each group of 2 pixels; in the case of encoding and compressing the first image block by using the BISE13, the pixels of the first image block are divided into 4 groups of 4 pixels.
Illustratively, as shown in FIG. 3, taking the number of group elements M as 4 and the first image block as a 4×4 image block as an example, 16 pixels in the first image block are divided into just 4 groups with 4 pixels as a group, e.g., the first group includes d 00 To d 03 The second group includes d 10 To d 13 The third group includes d 20 To d 23 The fourth group includes d 30 To d 33 The method comprises the steps of carrying out a first treatment on the surface of the Or taking the number M of group elements as 5, taking the first image block as a 4×4 image block as an example, dividing 16 pixels in the first image block into 3 groups by taking 5 pixels as a group, and not performing grouping processing on the rest 1 pixels.
In step 203b, the electronic device adopts a target encoding mode to encode and compress each group of image data, so as to obtain each group of encoded image data.
In the embodiment of the present application, the target data includes each set of encoded image data and image data of non-grouped pixels in the first image block.
In the embodiment of the application, for each group of image data, coding compression is performed according to an algorithm corresponding to a target coding mode, so as to obtain each group of corresponding coded image data.
For BISE3, taking the first image block as a 4×4 image block as an example, dividing 16 pixels of the first image block into 3 groups, firstly respectively taking 2 bits of the highest data of 5 pixels in one group, multiplying by the 0 th power, the 1 st power, the 2 nd power, the 3 rd power and the 4 th power of 3 in sequence, accumulating to obtain 8-bit image data, performing the same operation on 5 pixels of each group to obtain 3 groups of 8-bit image data, and adding the image data of pixels which do not participate in grouping to finally obtain target data.
For BISE5, taking the first image block as a 4×4 image block as an example, dividing 16 pixels of the first image block into 5 groups, firstly respectively taking 3 bits of the highest data of 3 pixels in one group, multiplying by the power of 0, the power of 1 and the power of 2 of 5 in sequence, accumulating to obtain 7-bit image data, performing the same operation on 3 pixels of the rest groups to obtain 5 groups of 7-bit image data, and adding the image data of pixels which do not participate in grouping to finally obtain target data.
For example 3, regarding BISE7, taking the first image block as a 4×4 image block as an example, dividing 16 pixels of the first image block into 2 groups, firstly respectively taking 3 bits of the highest data of 6 pixels in one group, multiplying by the 0 th power, the 1 st power, the 2 nd power, the 3 rd power, the 4 th power and the 5 th power of 7 in sequence, accumulating to obtain 17 bits of image data, then performing the same operation processing on 6 pixels of each other group to obtain 2 groups of 17 bits of image data, and adding the image data of pixels which do not participate in grouping to finally obtain the target data.
In example 4, regarding BISE9, taking the first image block as a 4×4 image block as an example, dividing 16 pixels of the first image block into 4 groups, firstly respectively taking the 4 bits of the highest data of the 4 pixels in one group, multiplying by the 0 th power, the 1 st power, the 2 nd power and the 3 rd power of 9 in sequence, accumulating to obtain 13-bit image data, performing the same operation on the 4 pixels of each other group to obtain 4 groups of 13-bit image data, and adding the image data of the pixels which do not participate in grouping to obtain the target data.
In example 5, regarding the BISE11, taking the first image block as a 4×4 image block as an example, dividing 16 pixels of the first image block into 8 groups, firstly taking the 4 bits of the highest data of 2 pixels in one group, multiplying by the 0 th power and the 1 st power of 11 in sequence, accumulating to obtain 7-bit image data, performing the same operation on the 2 pixels of each other group to obtain 8 groups of 7-bit image data, and adding the image data of the pixels which do not participate in grouping to obtain the target data finally.
For example 6, regarding the BISE13, taking the first image block as a 4×4 image block as an example, dividing 16 pixels of the first image block into 4 groups, firstly respectively taking the 4 bits of the highest data of the 4 pixels in one group, multiplying by the 0 th power, the 1 st power, the 2 nd power and the 3 rd power of 16 in sequence, accumulating to obtain one 15-bit image data, performing the same operation on the 4 pixels of each other to obtain 4 groups of 15-bit image data, and adding the image data of the pixels which do not participate in grouping to finally obtain the target data.
It should be noted that, each of the above method examples, or various possible implementation manners in each of the method examples, may be executed separately, or may be executed in any two or more combinations with each other, and may specifically be determined according to actual use requirements, which is not limited by the embodiment of the present application.
Therefore, the electronic equipment can calculate images of different image data based on algorithms of different coding modes, so that the application range of the BISE mode for image compression is expanded.
Optionally, in an embodiment of the present application, as shown in fig. 4 in conjunction with fig. 1, after step 203, the image processing method provided in the embodiment of the present application further includes step 301:
step 301, the electronic device adds a target identifier in the target data.
In the embodiment of the present application, the target identifier indicates a target coding mode.
In the embodiment of the application, the target mark can be in a binary number form or a special mark.
For example, taking a target identifier as a binary value as an example, adding an identifier 010 to target data obtained by adopting a first coding mode for coding compression; adding a mark 111 in target data obtained by adopting a second coding mode for coding compression; adding an identifier 101 into target data obtained by adopting a third coding mode for coding compression; adding an identifier 011 in target data obtained by adopting a fourth coding mode for coding compression; adding an identifier 100 into target data obtained by adopting a fifth coding mode for coding compression; the identifier 110 is added to the target data obtained by encoding and compressing by the sixth encoding method, and the identifier 00 is added to the uncompressed data.
Therefore, the electronic equipment can add different identifications to the target data obtained by encoding by adopting different encoding modes, so that the electronic equipment can identify the corresponding encoding modes according to the different identifications, and the subsequent decompression operation of the electronic equipment by using different encoding modes is convenient.
Optionally, in an embodiment of the present application, as shown in fig. 5 in conjunction with fig. 4, after step 301, the image processing method provided in the embodiment of the present application further includes step 401:
step 401, the electronic device decompresses the target data according to the target coding mode indicated by the target identifier, and decompressed data is obtained.
In the embodiment of the application, target data is acquired, and decompression coding operation of the target coding mode is respectively carried out on each group of coded image data in the target data according to the target coding mode indicated by the target identifier in the target data, so as to obtain each group of decompressed image data.
By way of example, referring to fig. 3, and referring to fig. 6, in combination with the above example 4, using BISE9 as an example, 4 sets of 13-bit image data are sequentially read, and for the first data of the first set of image data, the upper 4 bits d of the first data of the first set of image data are obtained by taking the remainder of 9 00 :[n-1:n-4]The quotient divided by 9 is then divided by 9 to obtain the upper 4 bits d of the second data of the first group of image data 01 :[n-1:n-4]The quotient divided by 81 is then divided by 9 to obtain the upper 4 bits d of the third data of the first group of image data 02 :[n-1:n-4]The quotient divided by 729 is the upper 4 bits d of the fourth data of the first group of image data 03 :[n-1:n-4]. And repeating the step to process each group of coded image data to obtain the high 4 bits of all data in the 4x4 image block, and finally combining the highest bit with the low bit in sequence to obtain decompressed image data.
Therefore, the electronic equipment can quickly distinguish the target coding mode adopted by the target data through different target identifiers in the target data, so that the electronic equipment can conveniently decompress the target data in a corresponding mode according to different target coding modes.
The whole process of the image processing method provided by the embodiment of the present application is described below in one possible embodiment. Referring to fig. 2, as shown in fig. 7, specifically, steps B1 to B19 are included:
step B1, the electronic device reads n bits of image data of a 4x4 block in the image, namely the image data of the first image block, and the total is 16n bits.
And B2, the electronic equipment determines the maximum value max of the input data, namely the first data value by comparing the sizes of the data values in the image data of the 4x4 blocks.
Step B3, the electronic device judges whether the maximum value max, i.e. the first data value is less than 3×2 n-2 If the difference is smaller than the preset threshold, the step B4 is executed, and otherwise the step B7 is executed.
Step B4, the electronic equipment judges whether the maximum value max is less than 5 multiplied by 2 n-3 If the difference is smaller than the preset threshold, the step B5 is executed, and otherwise the step B6 is executed.
Step B5, the electronic equipment judges whether the maximum value max is less than 9 multiplied by 2 n-4 If the image compression mode is smaller than the BISE9, the step B9 is executed, otherwise, the image compression mode of the BISE5 is adopted, and the step B10 is executed.
Step B6, the electronic equipment judges whether the maximum value max is smaller than 11 multiplied by 2 n-4 If the compression mode is smaller than the preset compression mode, the step B11 is executed, otherwise, the image compression mode of the BISE3 is adopted, and the step B12 is executed.
Step B7, the electronic device judges whether the maximum value max is less than 7 multiplied by 2 n-3 If the data is smaller than the predetermined value, the step B8 is executed, otherwise the data is not compressed, and then the step B15 is executed.
Step B8, the electronic device judges whether the maximum value max is less than 13 multiplied by 2 n-4 If the image compression mode is smaller than the preset threshold, the image compression mode of BISE13 is adopted, then the step B13 is executed, otherwise, the image compression mode of BISE7 is adopted, and then the step B14 is executed.
Step B9, the electronic device adds the flag 111, that is, the target identifier, before the compressed data stream, and then performs step 116.
Step B10, the electronic device adds the flag 110 before the compressed image data, and then performs step 116.
Step B11, the electronic device adds the flag 101 before the compressed image data, and then performs step 116.
Step B12, the electronic device adds the flag 100 before the compressed image data, and then performs step 116.
Step B13, the electronic device adds a flag 011 before the compressed image data, and then performs step 116.
Step B14, the electronic device adds a flag 010 before the compressed image data, and then performs step 116.
Step B15, the electronic device adds a flag 00 before the compressed image data, and then performs step 116.
Step B16, the electronic device combines the flag, the compressed high order bits, the uncompressed low order bits, and all the uncompressed pixel data into variable-length image data, i.e., the target data, and the decompression process executes step B17.
And B17, the electronic equipment reads the flag bit of the compressed image data.
And B18, the electronic equipment selects a corresponding BISE compression mode according to the zone bit to perform a corresponding decompression process.
Step B19, outputting n-bit 4x4 block complete image data.
In this way, compared with the BISE compression mode based on 3 and the BISE compression mode based on 5 which have been proposed, the embodiment of the application adds 4 BISE compression modes based on 7, 9, 11, 13 and the like for images, the combination mode has wider application range and smaller data compression rate, thereby realizing lossless compression of information in images, ensuring the quality of transmitted pictures, effectively saving storage space of compressed data compared with original data, and improving transmission rate to a certain extent.
It should be noted that, in the image processing method provided by the embodiment of the present application, the execution subject may be an image processing apparatus, or an electronic device, or may be a functional module or entity in the electronic device. In the embodiment of the present application, an image processing apparatus is described by taking an example of an image processing method performed by the image processing apparatus.
Fig. 8 shows a schematic diagram of one possible configuration of an image processing apparatus involved in an embodiment of the present application. As shown in fig. 8, the image processing apparatus 700 may include: an acquisition module 701, a determination module 702, and a processing module 703;
the acquiring module 701 is configured to acquire a data amount and a data value of image data of each pixel point in the first image block, where the data amount of the image data of each pixel point is the same; a determining module 702, configured to select a target encoding mode from N preset encoding modes based on a first data value, where the first data value is a data value of image data of a first pixel, and the first pixel is a pixel with a maximum data value of image data in a first image block; a processing module 703, configured to perform encoding compression on the first image block acquired by the acquiring module 701 by using the target encoding manner determined by the determining module 702, so as to obtain target data; the N preset coding modes comprise at least one of the following: a first coding scheme, a second coding scheme, a third coding scheme, a fourth coding scheme, a fifth coding scheme, and a sixth coding scheme; the maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the first encoding mode is larger than or equal to 13 multiplied by 2 n-4 And less than 7 x 2 n-3 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the second encoding mode is less than 9 multiplied by 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the third encoding mode is more than or equal to 5 multiplied by 2 n-3 And less than 11 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the fourth encoding mode is more than or equal to 3 multiplied by 2 n-2 And is less than 13 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixels subjected to the encoding compression by the fifth encoding method is larger than or equal to 11×2 n-4 And less than 3 x 2 n-2 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by the sixth encoding mode is more than or equal to 9×2 n-4 And less than 5 x 2 n-3 N is the data amount of the image data of the pixel point subjected to the encoding compression.
Optionally, in the embodiment of the present application, the processing module 703 is specifically configured to:
grouping the image data of all the pixel points in the first image block according to the group element number M corresponding to the target coding mode determined by the determining module 702, where each group of image data includes image data of M pixel points; each group of image data is respectively encoded and compressed by adopting the target encoding mode determined by the determining module 702, so as to obtain each group of encoded image data; the target data includes each set of encoded image data and image data for non-grouped pixels in the first image block.
Wherein the number M of group elements corresponding to the first coding mode is 6; the number M of group elements corresponding to the second coding mode and the fourth coding mode is 4; the number M of group elements corresponding to the third coding mode is 2; the number M of group elements corresponding to the fifth coding mode is 5; the number M of group elements corresponding to the sixth coding scheme is 3.
Optionally, in an embodiment of the present application, the processing module 703 is further configured to, when the first data value is greater than 7×2 n-3 In the case of (a), it is determined that the first image block is not to be code compressed.
Optionally, in an embodiment of the present application, in conjunction with fig. 8, as shown in fig. 9, the image processing apparatus 700 further includes: an add module 704; the adding module 704 is configured to, after encoding and compressing the first image block by using the target encoding mode to obtain target data, add a target identifier to the target data, where the target identifier indicates the target encoding mode.
Optionally, in an embodiment of the present application, in conjunction with fig. 8, as shown in fig. 10, the image processing apparatus 700 further includes: decompression module 705: the decompression module 705 is configured to decompress the target data according to the target coding method determined by the determination module 702 indicated by the target identifier added by the adding module 704 after the adding module 704 adds the target identifier to the target data, to obtain decompressed data.
In the image processing device provided by the embodiment of the application, the device acquires the data volume and the data value of the image data of each pixel point in the first image block, and the data volume of the image data of each pixel point is the same; selecting a target coding mode from N preset coding modes based on a first data value, wherein the first data value is the data value of the image data of a first pixel point, and the first pixel point is the pixel point with the maximum data value of the image data in a first image block; encoding and compressing the first image block by adopting a target encoding mode to obtain target data; the N preset coding modes comprise at least one of the following: a first coding scheme, a second coding scheme, a third coding scheme, a fourth coding scheme, a fifth coding scheme, and a sixth coding scheme; the maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the first encoding mode is larger than or equal to 13 multiplied by 2 n-4 And less than 7 x 2 n-3 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the second encoding mode is less than 9 multiplied by 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the third encoding mode is more than or equal to 5 multiplied by 2 n-3 And less than 11 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the fourth encoding mode is more than or equal to 3 multiplied by 2 n-2 And is less than 13 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixels subjected to the encoding compression by the fifth encoding method is larger than or equal to 11×2 n-4 And less than 3 x 2 n-2 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by the sixth encoding mode is more than or equal to 9 multiplied by 2 n-4 And less than 5 x 2 n-3 N is the data amount of the image data of the pixel point subjected to the encoding compression. In this way, the value range of the image data value of the pixel point subjected to coding compression is widened by adding N preset coding modes, so that the electronic equipment can perform lossless compression on more images; meanwhile, the electronic device can flexibly select a target coding mode with smaller data compression rate according to the maximum data values of different image data, therebyThe compression rate of the image data is reduced.
The image processing device in the embodiment of the application can be an electronic device, or can be a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. By way of example, the electronic device may be a mobile phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, mobile internet appliance (Mobile Internet Device, MID), augmented reality (augmented reality, AR)/Virtual Reality (VR) device, robot, wearable device, ultra-mobile personal computer, UMPC, netbook or personal digital assistant (personal digital assistant, PDA), etc., but may also be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The image processing apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android operating system, an ios operating system, or other possible operating systems, and the embodiment of the present application is not limited specifically.
The image processing device provided in the embodiment of the present application can implement each process implemented by the embodiments of the methods of fig. 1 to 7, and in order to avoid repetition, a description is omitted here.
Optionally, as shown in fig. 11, the embodiment of the present application further provides an electronic device 800, including a processor 801 and a memory 802, where the memory 802 stores a program or an instruction that can be executed on the processor 801, and the program or the instruction implements each step of the embodiment of the image processing method when executed by the processor 801, and the steps achieve the same technical effects, so that repetition is avoided, and no further description is given here.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
Fig. 12 is a schematic hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 100 includes, but is not limited to: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.
Those skilled in the art will appreciate that the electronic device 100 may further include a power source (e.g., a battery) for powering the various components, and that the power source may be logically coupled to the processor 110 via a power management system to perform functions such as managing charging, discharging, and power consumption via the power management system. The electronic device structure shown in fig. 12 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than illustrated, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
The processor 110 is configured to obtain a data amount and a data value of image data of each pixel point in the first image block, where the data amount of the image data of each pixel point is the same; the processor 110 is further configured to select a target encoding mode from the N preset encoding modes based on a first data value, where the first data value is a data value of image data of a first pixel, and the first pixel is a pixel with a maximum data value of image data in the first image block; the processor 110 is further configured to encode and compress the first image block by using the target encoding manner determined by the processor 110, so as to obtain target data; the N preset coding modes comprise at least one of the following: a first coding scheme, a second coding scheme, a third coding scheme, a fourth coding scheme, a fifth coding scheme, and a sixth coding scheme; the maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the first encoding mode is larger than or equal to 13 multiplied by 2 n-4 And less than 7 x 2 n-3 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the second encoding mode is less than 9 multiplied by 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the third encoding mode is more than or equal to 5 multiplied by 2 n-3 And less than 11 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the Using fourth codingThe maximum value of the data values of the image data of the pixels subjected to the encoding compression is greater than or equal to 3×2 n-2 And is less than 13 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixels subjected to the encoding compression by the fifth encoding method is larger than or equal to 11×2 n-4 And less than 3 x 2 n-2 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by the sixth encoding mode is more than or equal to 9 multiplied by 2 n-4 And less than 5 x 2 n-3 N is the data amount of the image data of the pixel point subjected to the encoding compression.
Optionally, in an embodiment of the present application, the processor 110 is specifically configured to:
grouping the image data of all pixel points in the first image block according to the group element number M corresponding to the target coding mode, wherein each group of image data comprises the image data of M pixel points; respectively carrying out coding compression on each group of image data by adopting a target coding mode to obtain each group of coded image data; the target data comprises each group of encoded image data and image data of ungrouped pixel points in the first image block; wherein the number M of group elements corresponding to the first coding mode is 6; the number M of group elements corresponding to the second coding mode and the fourth coding mode is 4; the number M of group elements corresponding to the third coding mode is 2; the number M of group elements corresponding to the fifth coding mode is 5; the number M of group elements corresponding to the sixth coding scheme is 3.
Optionally, in an embodiment of the present application, the processor 110 is further configured to, when the first data value is greater than 7×2 n-3 In the case of (a), it is determined that the first image block is not to be code compressed.
Optionally, in the embodiment of the present application, the processor 110 is further configured to, after encoding and compressing the first image block by using a target encoding mode to obtain target data, add a target identifier to the target data, where the target identifier indicates the target encoding mode.
Optionally, in the embodiment of the present application, the processor 110 is further configured to decompress the target data according to the target coding mode indicated by the target identifier after adding the target identifier to the target data, to obtain decompressed data.
In the electronic device provided by the embodiment of the application, the electronic device acquires the data volume and the data value of the image data of each pixel point in the first image block, and the data volume of the image data of each pixel point is the same; selecting a target coding mode from N preset coding modes based on a first data value, wherein the first data value is the data value of the image data of a first pixel point, and the first pixel point is the pixel point with the maximum data value of the image data in a first image block; encoding and compressing the first image block by adopting a target encoding mode to obtain target data; the N preset coding modes comprise at least one of the following: a first coding scheme, a second coding scheme, a third coding scheme, a fourth coding scheme, a fifth coding scheme, and a sixth coding scheme; the maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the first encoding mode is larger than or equal to 13 multiplied by 2 n-4 And less than 7 x 2 n-3 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the second encoding mode is less than 9 multiplied by 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the third encoding mode is more than or equal to 5 multiplied by 2 n-3 And less than 11 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the fourth encoding mode is more than or equal to 3 multiplied by 2 n-2 And is less than 13 x 2 n-4 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixels subjected to the encoding compression by the fifth encoding method is larger than or equal to 11×2 n-4 And less than 3 x 2 n-2 The method comprises the steps of carrying out a first treatment on the surface of the The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by the sixth encoding mode is more than or equal to 9 multiplied by 2 n-4 And less than 5 x 2 n-3 N is the data amount of the image data of the pixel point subjected to the encoding compression. In this way, the value range of the image data value of the pixel point subjected to coding compression is widened by adding N preset coding modes, so that the electronic equipment can perform lossless compression on more images; meanwhile, the electronic device can be used for outputting the maximum data value according to different image dataThe target coding mode with smaller data compression rate is flexibly selected, so that the compression rate of the image data is reduced.
It should be appreciated that in embodiments of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, the graphics processor 1041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also referred to as a touch screen. The touch panel 1071 may include two parts of a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
Memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a first memory area storing programs or instructions and a second memory area storing data, wherein the first memory area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 109 may include volatile memory or nonvolatile memory, or the memory 109 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM), static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (ddr SDRAM), enhanced SDRAM (Enhanced SDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). Memory 109 in embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
Processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor that primarily processes operations involving an operating system, user interface, application programs, etc., and a modem processor that primarily processes wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The embodiment of the application also provides a readable storage medium, on which a program or an instruction is stored, which when executed by a processor, implements each process of the above image processing method embodiment, and can achieve the same technical effects, and in order to avoid repetition, a detailed description is omitted here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application further provides a chip, which comprises a processor and a communication interface, wherein the communication interface is coupled with the processor, and the processor is used for running programs or instructions to realize the processes of the embodiment of the image processing method, and can achieve the same technical effects, so that repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
Embodiments of the present application provide a computer program product stored in a storage medium, where the program product is executed by at least one processor to implement the respective processes of the above-described image processing method embodiments, and achieve the same technical effects, and for avoiding repetition, a detailed description is omitted herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises 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 an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.

Claims (14)

1. An image processing method, the method comprising:
acquiring the data quantity and the data value of the image data of each pixel point in the first image block, wherein the data quantity of the image data of each pixel point is the same;
selecting a target coding mode from N preset coding modes based on a first data value, wherein the first data value is the data value of image data of a first pixel point, and the first pixel point is the pixel point with the maximum data value of the image data in the first image block;
adopting the target coding mode to code and compress the first image block to obtain target data;
wherein, the N preset encoding modes comprise at least one of the following: a first coding scheme, a second coding scheme, a third coding scheme, a fourth coding scheme, a fifth coding scheme, and a sixth coding scheme;
the maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the first encoding mode is larger than or equal to 13 multiplied by 2 n-4 And less than 7 x 2 n-3
The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the second encoding mode is less than 9 multiplied by 2 n-4
The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the third encoding mode is more than or equal to 5 multiplied by 2 n-3 And less than 11 x 2 n-4
The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the fourth encoding mode is more than or equal to 3 multiplied by 2 n-2 And is less than 13 x 2 n-4
Image data of pixels subjected to encoding compression by adopting the fifth encoding modeThe maximum value of the data values is greater than or equal to 11 x 2 n-4 And less than 3 x 2 n-2
The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the sixth encoding mode is more than or equal to 9 multiplied by 2 n-4 And less than 5 x 2 n-3 N is the data amount of the image data of the pixel point subjected to the encoding compression.
2. The method according to claim 1, wherein said encoding and compressing the first image block by using the target encoding method to obtain target data includes:
grouping the image data of all pixel points in the first image block according to the group element number M corresponding to the target coding mode, wherein each group of image data comprises the image data of M pixel points;
adopting the target coding mode to respectively code and compress each group of image data to obtain each group of coded image data;
the target data includes the each set of encoded image data and image data for non-grouped pixels in the first image block.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the number M of group elements corresponding to the first coding mode is 6;
the number M of group elements corresponding to the second coding mode and the fourth coding mode is 4;
the number M of group elements corresponding to the third coding mode is 2;
the number M of group elements corresponding to the fifth coding mode is 5;
and the number M of group elements corresponding to the sixth coding mode is 3.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
at the first data value greater than 7×2 n-3 In the case of (a), it is determined not to be oppositeThe first image block is code compressed.
5. The method according to claim 1, wherein after said encoding and compressing the first image block by the target encoding method to obtain target data, the method further comprises:
and adding a target identifier in the target data, wherein the target identifier indicates the target coding mode.
6. A method according to claim 3, wherein after adding a target identification to the target data, the method further comprises:
and decompressing the target data according to the target coding mode indicated by the target identifier to obtain decompressed data.
7. An image processing apparatus, characterized in that the image processing apparatus comprises: the device comprises an acquisition module, a determination module and a processing module;
the acquisition module is used for acquiring the data volume and the data value of the image data of each pixel point in the first image block, wherein the data volume of the image data of each pixel point is the same;
the determining module is configured to select a target encoding mode from N preset encoding modes based on a first data value, where the first data value is a data value of image data of a first pixel, and the first pixel is a pixel with a maximum data value of image data in the first image block acquired by the acquiring module;
the processing module is used for carrying out coding compression on the first image block by adopting the target coding mode determined by the determining module to obtain target data;
wherein, the N preset encoding modes comprise at least one of the following: a first coding scheme, a second coding scheme, a third coding scheme, a fourth coding scheme, a fifth coding scheme, and a sixth coding scheme;
the first coding mode is adopted for carrying outThe maximum value of the data values of the image data of the encoded compressed pixel points is greater than or equal to 13×2 n-4 And less than 7 x 2 n-3
The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the second encoding mode is less than 9 multiplied by 2 n-4
The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the third encoding mode is more than or equal to 5 multiplied by 2 n-3 And less than 11 x 2 n-4
The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the fourth encoding mode is more than or equal to 3 multiplied by 2 n-2 And is less than 13 x 2 n-4
The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the fifth encoding mode is larger than or equal to 11 multiplied by 2 n-4 And less than 3 x 2 n-2
The maximum value of the data values of the image data of the pixel points subjected to the encoding compression by adopting the sixth encoding mode is more than or equal to 9 multiplied by 2 n-4 And less than 5 x 2 n-3 N is the amount of image data of the pixel point subjected to encoding compression.
8. The apparatus of claim 7, wherein the device comprises a plurality of sensors,
the processing module is specifically configured to:
grouping the image data of all pixel points in the first image block according to the group element number M corresponding to the target coding mode determined by the determining module, wherein each group of image data comprises the image data of M pixel points;
Adopting the target coding mode determined by the determining module to respectively code and compress each group of image data to obtain each group of coded image data;
the target data includes the each set of encoded image data and image data for non-grouped pixels in the first image block.
9. The apparatus of claim 8, wherein the device comprises a plurality of sensors,
the number M of group elements corresponding to the first coding mode is 6;
the number M of group elements corresponding to the second coding mode and the fourth coding mode is 4;
the number M of group elements corresponding to the third coding mode is 2;
the number M of group elements corresponding to the fifth coding mode is 5;
and the number M of group elements corresponding to the sixth coding mode is 3.
10. The apparatus of claim 7 or 8, wherein the processing module is further configured to, when the first data value is greater than 7 x 2 n-3 In the event that it is determined not to code compress the first image block.
11. The apparatus of claim 7, wherein the apparatus further comprises: adding a module;
the adding module is configured to perform encoding compression on the first image block by using the target encoding mode to obtain target data, and then add a target identifier to the target data processed by the processing module, where the target identifier indicates the target encoding mode.
12. The apparatus of claim 11, wherein the apparatus further comprises: decompression module:
the decompressing module is configured to decompress the target data processed by the processing module according to the target coding mode determined by the determining module indicated by the target identifier added by the adding module after the adding module adds the target identifier to the target data, so as to obtain decompressed data.
13. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the image processing method according to any one of claims 1 to 6.
14. A readable storage medium, characterized in that the readable storage medium has stored thereon a program or instructions which, when executed by a processor, implement the steps of the image processing method according to any of claims 1 to 6.
CN202310957147.9A 2023-07-31 2023-07-31 Image processing method, device, electronic equipment and readable storage medium Pending CN116962693A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310957147.9A CN116962693A (en) 2023-07-31 2023-07-31 Image processing method, device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310957147.9A CN116962693A (en) 2023-07-31 2023-07-31 Image processing method, device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN116962693A true CN116962693A (en) 2023-10-27

Family

ID=88452762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310957147.9A Pending CN116962693A (en) 2023-07-31 2023-07-31 Image processing method, device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116962693A (en)

Similar Documents

Publication Publication Date Title
KR101461771B1 (en) An image compression method with random access capability
KR100972401B1 (en) Compression of images for computer graphics
EP2320380B1 (en) Multi-mode image processing
CN101253761B (en) Image encoding apparatus and image encoding method
CN110677649B (en) Artifact removing method based on machine learning, artifact removing model training method and device
EP4243415A1 (en) Image compression method and apparatus, and intelligent terminal and computer-readable storage medium
CN112218092A (en) Encoding method, apparatus and storage medium for string encoding technique
US11006119B1 (en) Compression encoding of images
CN110418209B (en) Information processing method applied to video transmission and terminal equipment
CN102271251B (en) Lossless image compression method
KR100968675B1 (en) Decoding variable length codes in jpeg applications
Shie et al. Data hiding based on compressed VQ indices of images
CN110545446B (en) Desktop image encoding and decoding methods, related devices and storage medium
Kelash et al. Utilization of steganographic techniques in video sequences
US9060171B2 (en) Image processing system and method
CN104602018B (en) The acquisition methods and device of the movable information of video data, coding method and device
CN116962693A (en) Image processing method, device, electronic equipment and readable storage medium
CN116320395A (en) Image processing method, device, electronic equipment and readable storage medium
CN108668169B (en) Image information processing method and device, and storage medium
CN115834906A (en) Video encoding and decoding method and device, electronic equipment and medium
CN115767085A (en) Data processing method and device
CN113038179A (en) Video encoding method, video decoding method, video encoding device, video decoding device and electronic equipment
US7003165B2 (en) Image processor and image processing method for decompressing progressive-coded compressed image data
CN109788160A (en) Image transfer method, device, electronic equipment and storage medium
CN111405349A (en) Information implantation method and device based on video content and storage medium

Legal Events

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