CN115103189A - Data processing method and device, computer equipment and readable storage medium - Google Patents

Data processing method and device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN115103189A
CN115103189A CN202210647936.8A CN202210647936A CN115103189A CN 115103189 A CN115103189 A CN 115103189A CN 202210647936 A CN202210647936 A CN 202210647936A CN 115103189 A CN115103189 A CN 115103189A
Authority
CN
China
Prior art keywords
image data
compressed
data
mode
coding mode
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
CN202210647936.8A
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.)
Shenzhen Aixiesheng Technology Co Ltd
Original Assignee
Shenzhen Aixiesheng Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Aixiesheng Technology Co Ltd filed Critical Shenzhen Aixiesheng Technology Co Ltd
Priority to CN202210647936.8A priority Critical patent/CN115103189A/en
Publication of CN115103189A publication Critical patent/CN115103189A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
    • 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/103Selection of coding mode or of prediction mode
    • 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/186Methods 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 colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application provides a data processing method, a data processing device, computer equipment and a readable storage medium, wherein the method comprises the following steps: acquiring image data to be compressed, and identifying RGB sub-pixel component values of the image data to be compressed; determining a coding mode corresponding to image data to be compressed according to the RGB sub-pixel component values; coding image data to be compressed according to a coding mode to obtain effective data bits; and combining the flag bit corresponding to the coding mode with the effective data bit to form compressed image data. The application provides a compression method for image data, can carry out reasonable effectual compression to the image data in RGB color space, when guaranteeing the compression effect, reduce required occupation resource, realize the effect of low-cost completion data compression.

Description

Data processing method and device, computer equipment and readable storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a data processing method and apparatus, a computer device, and a readable storage medium.
Background
Currently, for video data, the main purpose of video coding is to compress the data. The pixel-form representation of the dynamic image brings huge data volume, so that the storage space and the transmission broadband can not meet the requirements of storage and transmission at all. For example, if three color components RGB of each pixel of an image each require one byte representation, then each pixel requires at least 3 bytes, and the size of the image is 2.76 mbytes with a resolution of 1280 × 720. If the frame rate is 30 frames/second for the same resolution video, the required rate of transmission will reach 662.4 Mb/s. And as the screen refresh rate increases, the required bandwidth is more and more demanding, which also means that more hardware resources are required. Therefore, how to compress video data becomes a necessary solution in the technical field of data processing.
During the course of research and practice on the prior art, the inventors of the present application found that at least the following problems existed: the conventional image data compression method usually requires large hardware resources, is not suitable under the condition of limited chip area resources, and cannot achieve the effect of completing data compression at low cost. Therefore, a method for reducing the required occupied resources while ensuring the data compression effect is needed.
The foregoing description is provided for general background information and is not admitted to be prior art.
Disclosure of Invention
In view of the above technical problems, the present application provides a data processing method, an apparatus, a computer device, and a readable storage medium, which can solve the problem that in the prior art, when compressing image data, resources need to be occupied greatly, and achieve the effect of completing data compression at low cost.
In order to solve the above technical problem, the present application provides a data processing method, including the following steps:
acquiring image data to be compressed, and identifying RGB sub-pixel component values of the image data to be compressed;
determining a coding mode corresponding to the image data to be compressed according to the RGB sub-pixel component values;
coding the image data to be compressed according to the coding mode to obtain effective data bits;
and combining the flag bit corresponding to the coding mode with the effective data bit to form compressed image data.
Optionally, the obtaining of the image data to be compressed and identifying RGB sub-pixel component values of the image data to be compressed includes:
acquiring image data to be compressed of an original RGB color space, wherein the image data to be compressed comprises a plurality of image data arranged according to a first matrix;
and respectively identifying an R sub-pixel component value, a G sub-pixel component value and a B sub-pixel component value of the image data to be compressed.
Optionally, the determining, according to the RGB sub-pixel component values, the encoding mode corresponding to the image data to be compressed includes:
judging a data mode and a type flag bit corresponding to the RGB sub-pixel component values according to a preset rule;
and determining a coding mode corresponding to the image data to be compressed according to the data mode.
Optionally, before the acquiring the image data to be compressed, the method further includes:
acquiring an image to be compressed, and dividing the image to be compressed into a plurality of pixel blocks arranged according to the first matrix, wherein each pixel block comprises a plurality of pixels arranged according to the second matrix;
and converting the pixel blocks into image data to be compressed according to a preset RGB format.
Optionally, the data processing method further includes:
identifying a mode flag in the compressed image data;
determining a coding mode corresponding to the compressed image data according to the mode flag bit;
and decompressing the compressed image data according to the coding mode to obtain original image data.
Optionally, the decompressing the compressed image data according to the encoding mode to obtain original image data includes:
inputting the compressed image data into a first-in first-out queue for synchronous processing, and synchronizing to a corresponding clock domain;
storing the image data in each clock domain to a plurality of random access memories in a polling mode;
and reading the image data in the plurality of random access memories, decompressing and outputting original image data.
Correspondingly, the present application also provides a data processing apparatus, comprising:
the device comprises an acquisition module, a compression module and a compression module, wherein the acquisition module is used for acquiring image data to be compressed and identifying RGB sub-pixel component values of the image data to be compressed;
the first identification module is used for determining an encoding mode corresponding to the image data to be compressed according to the RGB sub-pixel component values;
the coding module is used for coding the image data to be compressed according to the coding mode to obtain effective data bits;
and the compression module is used for combining the zone bit corresponding to the coding mode with the effective data bit to form compressed image data.
Optionally, the data processing apparatus further includes:
the second identification module is used for identifying the mode flag bit in the compressed image data;
a third identification module, configured to determine, according to the mode flag, a coding mode corresponding to the compressed image data;
and the decompression module is used for decompressing the compressed image data according to the coding mode to obtain original image data.
An embodiment of the present application further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the data processing method according to any one of the above items when executing the computer program.
The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the data processing method described in any one of the above.
The embodiment of the application has the following beneficial effects:
as described above, the present application provides a data processing method, an apparatus, a computer device, and a readable storage medium, where the method includes: acquiring image data to be compressed, and identifying RGB sub-pixel component values of the image data to be compressed; determining a coding mode corresponding to image data to be compressed according to the RGB sub-pixel component values; coding image data to be compressed according to a coding mode to obtain effective data bits; and combining the flag bit corresponding to the coding mode with the effective data bit to form compressed image data. The application provides a compression method for image data, which is characterized in that a corresponding coding mode is determined by identifying RGB sub-pixel component values of image data to be compressed, the image data is combined with effective data bits after being coded according to different coding modes, so that the image data is compressed, the image data in RGB color space is reasonably and effectively compressed, the compression effect is ensured, the occupied resources are reduced, and the data compression is completed at low cost.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a first implementation of a data processing method provided in an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating a second implementation manner of a data processing method according to an embodiment of the present application;
fig. 3 is a schematic flow chart of data decompression provided by an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a first implementation of a data processing apparatus according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a second implementation manner of a data processing apparatus provided in an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a first implementation of a computer device provided by an embodiment of the present application;
fig. 7 is a schematic structural diagram of a second implementation of a computer device provided in an embodiment of the present application.
The implementation of the objectives, functional features, and advantages of the present application will be further described with reference to the accompanying drawings. Specific embodiments of the present application have been shown by way of example in the drawings and will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
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, the recitation of an element by the phrase "comprising an … …" does not exclude the presence of additional like elements in the process, method, article, or apparatus that comprises the element, and further, where similarly-named elements, features, or elements in different embodiments of the disclosure may have the same meaning, or may have different meanings, the specific meaning of which should be determined by its interpretation in the embodiment or by further combination of contexts in the embodiment.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope herein. The word "if," as used herein, may be interpreted as "at … …" or "when … …" or "in response to a determination," depending on the context. Also, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes" and/or "including," when used in this specification, specify the presence of stated features, steps, operations, elements, components, items, species, and/or groups, but do not preclude the presence, or addition of one or more other features, steps, operations, elements, components, items, species, and/or groups thereof. The terms "or," "and/or," "including at least one of the following," and the like, as used herein, are to be construed as inclusive or mean any one or any combination. For example, "includes at least one of: A. b, C "means" any of the following: a; b; c; a and B; a and C; b and C; a and B and C ", again for example," A, B or C "or" A, B and/or C "means" any of the following: a; b; c; a and B; a and C; b and C; a and B and C'. An exception to this definition will occur only when a combination of elements, functions, steps or operations are in some way inherently mutually exclusive.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of execution is not necessarily sequential, but may be alternated or performed with other steps or at least some of the sub-steps or stages of other steps.
The words "if", as used herein, may be interpreted as "at … …" or "when … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It should be noted that, step numbers such as S1 and S2 are used herein for the purpose of more clearly and briefly describing the corresponding content, and do not constitute a substantial limitation on the sequence, and those skilled in the art may perform S2 first and then S1 in the specific implementation, which should be within the scope of the present application.
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In the following description, suffixes such as "module", "part", or "unit" used to indicate elements are used only for facilitating the description of the present application, and have no particular meaning in themselves. Thus, "module", "component" or "unit" may be used mixedly.
In order to implement compression of video data or image data, a display stream compression method is proposed in the prior art, which is a visual lossless image compression technique. However, this technique requires large hardware resources and is not suitable for use in cases where chip area resources are limited.
In order to solve the above problems, the present application provides a data processing method, an apparatus, a computer device, and a readable storage medium, which perform reasonable and effective compression on image data in RGB color space, so as to reduce occupied resources while ensuring the compression effect, thereby achieving the technical effect of completing data compression at low cost.
Referring to fig. 1, fig. 1 is a schematic flow chart of a data processing method according to an embodiment of the present disclosure. The data processing method may specifically include:
s1, acquiring image data to be compressed, and identifying RGB sub-pixel component values of the image data to be compressed.
Specifically, for step S1, the image data to be compressed is first obtained, and the RGB sub-pixel component values of the original RGB color space of the image data to be compressed are identified.
Optionally, in some embodiments, step S1 may specifically include:
s11, obtaining image data to be compressed of an original RGB color space, wherein the image data to be compressed comprises a plurality of image data arranged according to a first matrix;
s12, respectively identifying R sub-pixel component values, G sub-pixel component values and B sub-pixel component values of the image data to be compressed.
Specifically, image data to be compressed of the original RGB color space is first acquired, and the image data to be compressed may include a plurality of image data arranged in a first matrix. Preferably, in a specific embodiment, image data of 6 pixels in total of 2 lines and 3 columns of the original RGB color space is obtained, and since in a common picture resolution, the picture column resolution is usually a multiple of 3, and the line resolution is usually an endorsement of 2, in this embodiment, the image data can be equally divided into pixel blocks of 2 lines and 3 columns, each pixel block containing 6 pixels. If the data amount of each pixel is 24 bits in the RGB888 format, the data amount corresponding to the image data obtained from 2 rows and 3 columns is 144 bits. After the image data to be compressed of the original RGB color space is obtained, the values of the three components of R/G/B of the image data to be compressed, namely the R sub-pixel component value, the G sub-pixel component value and the B sub-pixel component value, are respectively identified.
Optionally, in some embodiments, before step S1, the method may further include:
acquiring an image to be compressed, and dividing the image to be compressed into a plurality of pixel blocks arranged according to a first matrix, wherein each pixel block comprises a plurality of pixels arranged according to a second matrix;
and converting the pixel blocks into image data to be compressed according to a preset RGB format.
Specifically, an input image to be compressed is obtained, and the image to be compressed is equally divided into a plurality of pixel blocks arranged according to a first matrix, wherein the first matrix is preferably 2 rows by 3 columns; each pixel block comprises a plurality of pixels; and converting the pixel blocks into image data to be compressed according to a preset RGB format.
And S2, determining a coding mode corresponding to the image data to be compressed according to the RGB sub-pixel component values.
Specifically, in step S2, the encoding mode corresponding to the image data to be compressed is determined mainly according to the RGB sub-pixel component values of the image data to be compressed obtained through identification, and different types of image data to be compressed are encoded through different encoding modes, so that resources occupied by subsequent compression can be reduced, and the error of the compressed data is ensured to be low.
Optionally, in some embodiments, step S2 may specifically include:
s21, judging a data mode and a type flag bit corresponding to the RGB sub-pixel component values according to a preset rule;
and S22, determining a coding mode corresponding to the image data to be compressed according to the data mode.
Specifically, according to a preset rule, a data mode which is accorded with RGB sub-pixel component values in the image data to be compressed is judged, the type of the image data to be compressed is identified, and therefore a type flag bit is determined; and after the data mode is determined, determining the coding mode corresponding to the image data to be compressed according to the data mode.
In a specific embodiment, for how to determine the encoding mode corresponding to the image data to be compressed, the present embodiment provides 5 encoding modes, and each encoding mode can be divided into different types. The specific process is as follows: and selecting a corresponding coding mode according to the characteristics of the three R/G/B sub-pixels. For example, if the input 6 pixels all satisfy R ═ G ═ B, that is, the input is gray scale data, the mode 1 is assumed. If one or two sub-pixel components in the input 6 pixels are the same, the mode is 2. And if the difference value between the maximum value and the minimum value of the three input components of the 6 pixels R/G/B is within a preset range, the mode is 3. If the above three cases are not satisfied, the mode 4 is assumed. The above 4 modes all correspond to different mode flag bits, but considering that the mode 3 requires obviously more information than the mode 1, the number of allocated valid data bits is as large as possible, and therefore the number of bits of the mode flag bits is not fixed. For example, the mode flag bit of mode 1 is 1111, and the mode flag bit of mode 3 is 0.
In addition, each type is different in each coding mode, and correspondingly, each type is also corresponding to a different type flag bit. For example, pattern 3 is assigned a type flag bit of 6 bits, but still cannot cover all cases, and thus pattern 5 is added again, increasing the cases that are not covered in pattern 3. After determining the decision rules of the various encoding modes, it is also necessary to set priorities of the various encoding modes and ensure that the encoding mode and type of the image data to be compressed are not misjudged.
The encoding method is related to the bit width of the compressed data. Meanwhile, the classification condition can be adjusted according to the actual effect, and is not specifically limited herein.
And S3, coding the image data to be compressed according to the coding mode to obtain effective data bits.
Specifically, in step S3, the image data to be compressed is encoded according to the determined encoding mode, so as to obtain the valid data bits corresponding to the image to be compressed.
And S4, combining the flag bit corresponding to the coding mode with the effective data bit to form compressed image data.
Specifically, in step S4, the mode flag and the type flag corresponding to the encoding mode are combined with the valid data bits obtained by encoding to constitute compressed image data. For example, the 144-bit image data in step S1 is subjected to compression processing to obtain 48-bit data at a compression ratio of 1/3. The compressed 48-bit data includes a mode flag bit, a type flag bit and a valid data bit.
In a specific embodiment, for example, in mode 1, the mode bits are 1111 bits, and the remaining 44 bits. One subpixel takes 8 bits, so that data of 5 subpixels can also be stored. Since R/G/B are all equal, the discussion begins in cases. If one of the 6 data is equal to one of the other 5, then all data can be stored with 40 bits, and the remaining 4 bits are used to indicate which two data are the same, for a total of 15 cases. These 4 bits are the type flag bits. If the 6 data are all different, a portion of the valid data is lost. At this time, the type flag bit is 0000, and the remaining 40 bits are equally divided as much as possible to access valid data. It is divided into 39 bits of 6, 7, and the upper 6 bits and the upper 7 bits of the sub-pixel are stored respectively, the maximum error is 3, 1, and the last invalid data bit is left.
Optionally, as shown in fig. 2, in some embodiments, the data processing method may further include:
s5, identifying a mode flag bit in the compressed image data;
s6, determining a coding mode corresponding to the compressed image data according to the mode flag bit;
and S7, decompressing the compressed image data according to the coding mode to obtain original image data.
Specifically, the data processing method in the embodiment of the present application further provides a method for decompressing image data, and the specific process includes: firstly, acquiring compressed image data, and identifying a mode flag bit in the compressed image data; and determining which coding mode is adopted by the compressed image data according to the mode flag bit, so that the decompression processing is carried out on the residual data bits in the compressed image data according to the corresponding coding mode, and finally the decompressed image data is obtained.
Optionally, in some embodiments, step S7 may specifically include:
s71, inputting the compressed image data into a first-in first-out queue for synchronous processing, and synchronizing to a corresponding clock domain;
s72, storing the image data in each clock domain to a plurality of random access memories in a polling mode;
and S73, reading the image data in the plurality of random access memories, decompressing and processing the image data, and outputting the original image data.
Specifically, as shown in fig. 3, in order to reduce the hardware resources required for decompression, this embodiment further provides a decompression implementation manner, and since this embodiment implements the compression effect of 1/3, and the decoded data amount is 3 times of the compressed data amount, the compressed data is decoded in the same time, and the output clock is 3 times of the input clock frequency. Due to the cross-clock domain processing, the input compressed data needs to be synchronized to the output clock domain through the FIFO queue. The compressed 48-bit data can be regarded as the minimum effective unit of the compressed data stream, which corresponds to the decompressed two-row three-column pixel blocks. The compressed image is treated as having the same line resolution as the original image and the original column resolution of 1/3. Then the data of the next row compressed is actually decoded to be the first half or the second half of the two adjacent rows. The decoded image needs to be output line by line, so the decoded second line of data needs to be stored, otherwise, the decoded second line of data is lost. And the data after decoding is stored, the data is not directly stored, so that the required RAM is smaller.
According to the analysis, to solve a complete line of data, two lines of compressed data are read to be completed, and the second line also needs the two lines of data. The decoding of the first line therefore starts at the earliest with the start of the compressed data of the second line and ends at the earliest with the end of the compressed data of the second line. I.e. the time to send a line of decompressed data is the same as the time to receive a line of compressed data. The decompression of the second line also requires the compressed data of the first two lines, while the compressed data of the third line starts to be transmitted, so this embodiment provides 3 line buffers for accessing the compressed data.
After FIFO processing, 3 blocks of RAM are used for storing compressed data of the next 3 lines in turn, namely, a RAM round-robin mode is adopted. When the first line is decoded, the compressed data is read from the RAM1 and the RAM2 in sequence, and then decompressed according to the method mentioned herein, so that the compressed data of two lines is obtained, and the decompressed data of the first line is output. Therefore, two rows of data can be decoded simultaneously, but because a larger RAM is needed for storing the decoded second row, the decoding of the second row adopts a re-decoding mode to save hardware resources. After the second line is decoded, the data in the RAM1 and the RAM2 are completed, the compressed data in the third line is stored in the RAM3, the compressed data in the fourth line can be stored in the RAM1 to realize the operation of RAM round-robin, and the steps are repeated until the decoding of one frame of data is completed.
As can be seen from the above, the data processing method provided in the embodiment of the present application includes: acquiring image data to be compressed, and identifying RGB sub-pixel component values of the image data to be compressed; determining a coding mode corresponding to image data to be compressed according to the RGB sub-pixel component values; coding image data to be compressed according to a coding mode to obtain effective data bits; and combining the flag bit corresponding to the coding mode with the effective data bit to form compressed image data. The embodiment of the application provides a compression method for image data, which is characterized in that a corresponding coding mode is determined by identifying RGB sub-pixel component values of image data to be compressed, the image data is combined with effective data bits after being coded according to different coding modes, so that the image data is compressed, the image data in RGB color space is reasonably and effectively compressed, the compression effect is ensured, the occupied resources are reduced, and the data compression is completed at low cost.
Correspondingly, the present application further provides a data processing apparatus, please refer to fig. 4, where fig. 4 is a schematic structural diagram of the data processing apparatus provided in the present application, and specifically, the data processing apparatus may include an obtaining module 100, a first identifying module 200, an encoding module 300, and a compressing module 400.
The obtaining module 100 is configured to obtain image data to be compressed, and identify RGB sub-pixel component values of the image data to be compressed.
Specifically, for the obtaining module 100, the image data to be compressed is obtained first, and the RGB sub-pixel component values of the original RGB color space of the image data to be compressed are identified.
The first identifying module 200 is configured to determine an encoding mode corresponding to image data to be compressed according to RGB sub-pixel component values.
Specifically, the first identifying module 200 determines the encoding mode corresponding to the image data to be compressed mainly according to the RGB sub-pixel component values of the image data to be compressed, and encodes different types of image data to be compressed through different encoding modes, so that resources occupied by subsequent compression can be reduced, and the error of the compressed data is ensured to be low.
The encoding module 300 is configured to encode the image data to be compressed according to the encoding mode to obtain an effective data bit.
Specifically, the encoding module 300 is configured to perform encoding processing on image data to be compressed according to the determined encoding mode, so as to obtain an effective data bit corresponding to the image to be compressed.
A compression module 400, configured to combine the flag bit corresponding to the coding mode with the valid data bit to form compressed image data.
Specifically, the compression module 400 is configured to combine the mode flag bit and the type flag bit corresponding to the encoding mode with the encoded valid data bit to form compressed image data.
Optionally, as shown in fig. 5, in some embodiments, the data processing apparatus may further include:
a second recognition module 500, configured to recognize a mode flag in the compressed image data;
a third identifying module 600, configured to determine, according to the mode flag, a coding mode corresponding to the compressed image data;
the decompression module 700 is configured to decompress the compressed image data according to the encoding mode to obtain original image data.
In summary, in the data processing apparatus provided in the embodiment of the present application, the obtaining module 100 first obtains the image data to be compressed, and identifies RGB sub-pixel component values of the image data to be compressed; then, determining a coding mode corresponding to the image data to be compressed according to the RGB sub-pixel component values through the first identification module 200; then, the coding module 300 codes the image data to be compressed according to the coding mode to obtain effective data bits; finally, the compression module 400 combines the flag bit corresponding to the coding mode with the valid data bit to form compressed image data. Therefore, the data processing device of the embodiment of the application determines the corresponding coding mode by identifying the RGB sub-pixel component values of the image data to be compressed, and combines the image data with the effective data bits after coding according to different coding modes, so as to compress the image data, realize reasonable and effective compression of the image data in the RGB color space, reduce the occupied resources while ensuring the compression effect, and complete data compression at low cost.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a first implementation of the computer device provided in the embodiment of the present application. The computer device comprises a memory 10 and a processor 20, wherein the memory 10 stores a computer program, and the processor 20 realizes a data processing method when executing the computer program, and comprises the following steps: acquiring image data to be compressed, and identifying RGB sub-pixel component values of the image data to be compressed; determining a coding mode corresponding to image data to be compressed according to the RGB sub-pixel component values; coding image data to be compressed according to a coding mode to obtain effective data bits; and combining the flag bit corresponding to the coding mode with the effective data bit to form compressed image data.
The embodiment of the application also provides computer equipment, and the computer equipment can be a server. Referring to fig. 7, fig. 7 is a schematic structural diagram of a second implementation manner of a computer device according to an embodiment of the present disclosure. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program to run in the non-volatile storage medium. The database of the computer device is used for storing data such as data processing methods and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection.
The computer program is executed by a processor to implement a data processing method. The data processing method comprises the following steps: acquiring image data to be compressed, and identifying RGB sub-pixel component values of the image data to be compressed; determining a coding mode corresponding to image data to be compressed according to the RGB sub-pixel component values; coding image data to be compressed according to a coding mode to obtain effective data bits; and combining the flag bit corresponding to the coding mode with the effective data bit to form compressed image data.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements a data processing method, including the steps of: acquiring image data to be compressed, and identifying RGB sub-pixel component values of the image data to be compressed; determining a coding mode corresponding to image data to be compressed according to the RGB sub-pixel component values; coding image data to be compressed according to a coding mode to obtain effective data bits; and combining the flag bit corresponding to the coding mode with the effective data bit to form compressed image data.
In the data processing method, the corresponding coding mode is determined by identifying the RGB sub-pixel component values of the image data to be compressed, and the image data is coded according to different coding modes and then combined with the effective data bits, so that the image data is compressed, the image data in the RGB color space is reasonably and effectively compressed, the compression effect is ensured, the required occupied resources are reduced, and the data compression is completed at low cost.
It is to be understood that the foregoing scenarios are only examples, and do not constitute a limitation on application scenarios of the technical solutions provided in the embodiments of the present application, and the technical solutions of the present application may also be applied to other scenarios. For example, as can be known by those skilled in the art, with the evolution of system architecture and the emergence of new service scenarios, the technical solution provided in the embodiments of the present application is also applicable to similar technical problems.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The units in the device in the embodiment of the application can be merged, divided and deleted according to actual needs.
In the present application, the same or similar terminology, technical solutions and/or application scenario descriptions will be generally described in detail only when they occur for the first time, and when they occur repeatedly later, they are generally not repeated for brevity, and when understanding the technical solutions and the like of the present application, reference may be made to the same or similar terminology, technical solutions and/or application scenario descriptions and the like which are not described in detail later, and their previous detailed descriptions may be referred to.
In the present application, each embodiment is described with an emphasis on the description, and reference may be made to the description of other embodiments for parts that are not described or recited in any embodiment.
The technical features of the technical solution of the present application may be arbitrarily combined, and for brevity of description, all possible combinations of the technical features in the embodiments are not described, however, as long as there is no contradiction between the combinations of the technical features, the scope of the present application should be considered as being described in the present application.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, a controlled terminal, or a network device) to execute the method of each embodiment of the present application.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the present application are generated in whole or in part when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). Computer-readable storage media can be any available media that can be accessed by a computer or a data storage device, such as a server, data center, etc., that incorporates one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, storage Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.

Claims (10)

1. A data processing method, comprising the steps of:
acquiring image data to be compressed, and identifying RGB sub-pixel component values of the image data to be compressed;
determining a coding mode corresponding to the image data to be compressed according to the RGB sub-pixel component values;
coding the image data to be compressed according to the coding mode to obtain effective data bits;
and combining the flag bit corresponding to the coding mode with the effective data bit to form compressed image data.
2. The data processing method according to claim 1, wherein said obtaining image data to be compressed and identifying RGB sub-pixel component values of said image data to be compressed comprises:
acquiring image data to be compressed of an original RGB color space, wherein the image data to be compressed comprises a plurality of image data arranged according to a first matrix;
and respectively identifying an R sub-pixel component value, a G sub-pixel component value and a B sub-pixel component value of the image data to be compressed.
3. The data processing method according to claim 2, wherein said determining the encoding mode corresponding to the image data to be compressed according to the RGB sub-pixel component values comprises:
judging a data mode and a type flag bit corresponding to the RGB sub-pixel component values according to a preset rule;
and determining a coding mode corresponding to the image data to be compressed according to the data mode.
4. The data processing method of claim 1, wherein prior to the obtaining image data to be compressed, the method further comprises:
acquiring an image to be compressed, and dividing the image to be compressed into a plurality of pixel blocks arranged according to the first matrix, wherein each pixel block comprises a plurality of pixels arranged according to the second matrix;
and converting the pixel blocks into image data to be compressed according to a preset RGB format.
5. The data processing method of claim 1, wherein the method further comprises:
identifying a mode flag in the compressed image data;
determining a coding mode corresponding to the compressed image data according to the mode flag bit;
and decompressing the compressed image data according to the coding mode to obtain original image data.
6. The data processing method according to claim 5, wherein the decompressing the compressed image data according to the encoding mode to obtain original image data comprises:
inputting the compressed image data into a first-in first-out queue for synchronous processing, and synchronizing to a corresponding clock domain;
storing the image data in each clock domain to a plurality of random access memories in a polling mode;
and reading the image data in the plurality of random access memories, decompressing and outputting original image data.
7. A data processing apparatus, comprising:
the device comprises an acquisition module, a compression module and a compression module, wherein the acquisition module is used for acquiring image data to be compressed and identifying RGB sub-pixel component values of the image data to be compressed;
the first identification module is used for determining an encoding mode corresponding to the image data to be compressed according to the RGB sub-pixel component values;
the coding module is used for coding the image data to be compressed according to the coding mode to obtain effective data bits;
and the compression module is used for combining the zone bit corresponding to the coding mode with the effective data bit to form compressed image data.
8. The data processing apparatus of claim 7, further comprising:
the second identification module is used for identifying the mode flag bit in the compressed image data;
a third identification module, configured to determine, according to the mode flag, a coding mode corresponding to the compressed image data;
and the decompression module is used for decompressing the compressed image data according to the coding mode to obtain original image data.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the data processing method of any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the data processing method of any one of claims 1 to 6.
CN202210647936.8A 2022-06-08 2022-06-08 Data processing method and device, computer equipment and readable storage medium Pending CN115103189A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210647936.8A CN115103189A (en) 2022-06-08 2022-06-08 Data processing method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210647936.8A CN115103189A (en) 2022-06-08 2022-06-08 Data processing method and device, computer equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN115103189A true CN115103189A (en) 2022-09-23

Family

ID=83288922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210647936.8A Pending CN115103189A (en) 2022-06-08 2022-06-08 Data processing method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115103189A (en)

Similar Documents

Publication Publication Date Title
US10735727B2 (en) Method of adaptive filtering for multiple reference line of intra prediction in video coding, video encoding apparatus and video decoding apparatus therewith
US20210211728A1 (en) Image Compression Method and Apparatus
EP1722572B1 (en) 2-dimensional signal encoding/decoding method and device
JP5399416B2 (en) Video coding system with reference frame compression
CN107404654B (en) JPEG image decompression method, device and platform
US20130251261A1 (en) Method And Apparatus For Image Data Compression
CN113709489B (en) Video compression method, device, equipment and readable storage medium
US20180242023A1 (en) Image Coding and Decoding Method and Device
GB2539241B (en) Video processing system
US20150146785A1 (en) Video decoder memory bandwidth compression
CN116193130B (en) Method and system for improving transmission efficiency of image data in network
CN111918065A (en) Information compression/decompression method and device
CN108347602B (en) Method and apparatus for lossless compression of video data
US20240104780A1 (en) Image compression method and apparatus, and intelligent terminal and computer-readable storage medium
CN110399511A (en) Image cache method, equipment, storage medium and device based on Redis
CN114222129A (en) Image compression encoding method, image compression encoding device, computer equipment and storage medium
EP0875858B1 (en) Method and apparatus for compressing and decompressing image data
US9060171B2 (en) Image processing system and method
JPH0772839A (en) Color video display unit
CN109379591B (en) Image transcoding method, electronic device and computer readable storage medium
CN115103189A (en) Data processing method and device, computer equipment and readable storage medium
US20130011061A1 (en) Image compression method with fixed compression ratio, image decompression method, and electronic device thereof
US5701159A (en) Digital image decoding apparatus
CN115760539A (en) Image processing method and device and network equipment
WO2010031259A1 (en) Method and device for decoding and scaling images, image displaying system

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
CB02 Change of applicant information

Address after: 518000 District D and E, 7th Floor, Building 3, Tingwei Industrial Park, 6 Liufang Road, Xin'an Street, Baoan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen Aixiesheng Technology Co.,Ltd.

Address before: 518101 District D and E, 7th Floor, Building 3, Tingwei Industrial Park, 6 Liufang Road, Xin'an Street, Baoan District, Shenzhen City, Guangdong Province

Applicant before: SHENZHEN AIXIESHENG TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information