CN110087070B - Data compression method, device, equipment and medium - Google Patents

Data compression method, device, equipment and medium Download PDF

Info

Publication number
CN110087070B
CN110087070B CN201810078744.3A CN201810078744A CN110087070B CN 110087070 B CN110087070 B CN 110087070B CN 201810078744 A CN201810078744 A CN 201810078744A CN 110087070 B CN110087070 B CN 110087070B
Authority
CN
China
Prior art keywords
data
frame
coding
compressed
compression
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810078744.3A
Other languages
Chinese (zh)
Other versions
CN110087070A (en
Inventor
胡彦多
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiangsheng Shanghai Electronic Technology Co ltd
Original Assignee
Xiangsheng Shanghai Electronic 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 Xiangsheng Shanghai Electronic Technology Co ltd filed Critical Xiangsheng Shanghai Electronic Technology Co ltd
Priority to CN201810078744.3A priority Critical patent/CN110087070B/en
Publication of CN110087070A publication Critical patent/CN110087070A/en
Application granted granted Critical
Publication of CN110087070B publication Critical patent/CN110087070B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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
    • H04N19/107Selection of coding mode or of prediction mode between spatial and temporal predictive coding, e.g. picture refresh
    • 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/124Quantisation
    • 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/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/533Motion estimation using multistep search, e.g. 2D-log search or one-at-a-time search [OTS]

Abstract

The invention discloses a data compression method, a device, equipment and a medium. The method comprises the following steps: judging the compression coding mode of the data to be compressed; if the compression coding mode of the data to be compressed is intra-frame coding, inter-frame coding is carried out on the data to be compressed in advance; inter-frame decoding is carried out on data obtained by inter-frame coding; and carrying out intraframe coding on the data obtained by interframe decoding again to obtain the compressed data. According to the data compression method, the data compression device, the data compression equipment and the computer readable storage medium, the difference between noise generated by intra-frame coding and noise generated by inter-frame coding can be greatly reduced, and therefore the visual effect of an image is improved.

Description

Data compression method, device, equipment and medium
Technical Field
The present invention relates to the field of data compression technologies, and in particular, to a data compression method, apparatus, device, and computer-readable storage medium.
Background
With the continuous development of multimedia technology and the increasing demand of people for information, multimedia technology has become an important carrier for people to obtain information. It is desirable to be able to conveniently and quickly acquire various multimedia information such as sound, image, video image, and the like at any time and at any place. Therefore, the storage and transmission of multimedia information is a current research focus.
Multimedia information, particularly video information, has a massive dataness. Based on this, almost all video data is compressed in some form for ease of storage and transmission. In addition, video data is often compressed by using both intra-frame coding and inter-frame coding.
However, since the noise generated by intra-frame encoding the video data is different from the noise generated by inter-frame encoding the video data, when the video data is compressed to a certain degree, human eyes will recognize the inter-frame encoding area and the intra-frame encoding area in the video image, thereby reducing the visual effect of the image.
Disclosure of Invention
Embodiments of the present invention provide a data compression method, apparatus, device, and computer-readable storage medium, which can greatly reduce a difference between noise generated by intra-frame coding and noise generated by inter-frame coding, thereby improving a visual effect of an image.
According to an aspect of an embodiment of the present invention, there is provided a method for compressing data, the method including:
judging the compression coding mode of the data to be compressed;
if the compression coding mode of the data to be compressed is intra-frame coding, inter-frame coding is carried out on the data to be compressed in advance;
inter-frame decoding is carried out on data obtained by inter-frame coding;
and carrying out intraframe coding on the data obtained by interframe decoding again to obtain the compressed data.
In one embodiment, the compression encoding mode of the data to be compressed is intra-frame encoding or inter-frame encoding.
In one embodiment, the compression ratio of intra-coding is set to be smaller than a preset value.
In one embodiment, setting the compression ratio of intra-coding to be less than a preset value includes:
and setting the compression ratio of the intra-frame coding to be smaller than a preset value by adjusting the quantization coefficient.
In one embodiment, the data to be compressed is one or more pixels in a frame of image, or one or more macroblocks in a frame of image.
In one embodiment, the determining the compression encoding mode of the data to be compressed includes:
determining a compression coding mode of data to be compressed according to the position of the pixel in a frame of image; alternatively, the first and second electrodes may be,
and determining the compression coding mode of the data to be compressed according to the position of the macro block in the frame image.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for compressing data, the apparatus including:
the judging module is used for judging the compression coding mode of the data to be compressed;
the inter-frame coding module is used for pre-coding the data to be compressed in an inter-frame coding mode if the compression coding mode of the data to be compressed is intra-frame coding;
the inter-frame decoding module is used for performing inter-frame decoding on the data obtained by the inter-frame coding;
and the intraframe coding module is used for carrying out intraframe coding on the data obtained by interframe decoding again to obtain the compressed data.
In one embodiment, the compression encoding mode of the data to be compressed is intra-frame encoding or inter-frame encoding.
In one embodiment, the compression ratio of intra-coding is set to be smaller than a preset value.
In one embodiment, setting the compression ratio of intra-coding to be less than a preset value includes:
and setting the compression ratio of the intra-frame coding to be smaller than a preset value by adjusting the quantization coefficient.
In one embodiment, the data to be compressed is one or more pixels in a frame of image, or one or more macroblocks in a frame of image.
In one embodiment, the determining module is specifically configured to:
determining a compression coding mode of data to be compressed according to the position of the pixel in a frame of image; alternatively, the first and second electrodes may be,
and determining the compression coding mode of the data to be compressed according to the position of the macro block in the frame image.
According to still another aspect of embodiments of the present invention, there is provided an apparatus for compressing data, the apparatus including: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements the method for compressing data provided by embodiments of the present invention.
According to still another aspect of the embodiments of the present invention, there is provided a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement a method for compressing data provided by the embodiments of the present invention.
According to the data compression method, the device and the equipment and the computer readable storage medium provided by the embodiment of the invention, the interframe coding mode is only used for once interframe coding processing, and the intraframe coding mode is specifically that the interframe coding processing is firstly carried out and then the intraframe coding processing is carried out. Therefore, in the embodiment, when the data to be compressed is subjected to intra-frame coding, not only noise generated by intra-frame coding but also noise generated by inter-frame coding are introduced, and the noise generated by intra-frame coding is very small compared with the noise generated by inter-frame coding, so that the difference between the noise generated by intra-frame coding and the noise generated by inter-frame coding can be greatly reduced, and the visual effect of an image is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments of the present invention will be briefly described below, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart illustrating a method of compressing data according to an embodiment of the present invention;
FIG. 2 is a schematic diagram showing a configuration of a data compression apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram showing a hardware configuration of a data compression apparatus in the embodiment of the present invention.
Detailed Description
Features and exemplary embodiments of various aspects of the present invention will be described in detail below, and in order to make objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the present invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The intra-frame coding is to predict the data information of the part to be coded in the current frame by using the data information in the current frame. That is, intra-frame coding mainly achieves compression of images by removing spatial redundant information of the images. That is, intra-coding is predictive coding performed on a spatial domain.
The inter-frame coding is to predict the data information of the part to be coded in the current frame by using the data information in the adjacent frame of the current frame. That is, inter-frame coding mainly implements compression of an image by comparing data information between different frames on a time axis. That is, inter-coding is predictive coding performed in a time domain.
Obviously, the two encoding modes of intra-frame encoding and inter-frame encoding are different, and thus there is inevitably a difference between noise generated by intra-frame encoding of video data and noise generated by inter-frame encoding of video data. Therefore, when data to be compressed requiring intra-frame coding and data to be compressed requiring inter-frame coding coexist in a certain frame image of a video, if the video is compressed to a certain degree, human eyes will recognize an intra-frame coding region and an inter-frame coding region in the frame image, so that the visual effect of the image is reduced.
In view of the above, an embodiment of the present invention provides a data compression method, which performs two compression processes of inter-frame coding and intra-frame coding on data to be compressed that needs to be intra-frame coded, and performs only inter-frame coding compression on the data to be compressed that needs to be inter-frame coded, so as to reduce a difference between noise generated by the intra-frame coding and noise generated by the inter-frame coding, and improve a visual effect of an image.
Fig. 1 shows a flowchart of a data compression method in an embodiment of the present invention. Referring to fig. 1, the data compression method in the embodiment of the present invention mainly includes steps S110 to S140.
S110, judging the compression coding mode of the data to be compressed.
In some embodiments, the data to be compressed may be one pixel in a frame of image. That is, the compression processing can be performed on a single frame video image one by one in a pixel level manner.
Of course, in order to increase the calculation speed in the compression process, the data to be compressed may be a plurality of pixels in one frame image. That is, firstly, a single-frame video image is divided into a plurality of pixel blocks, and then each pixel block is compressed one by one, thereby realizing the compression processing of the single-frame video image. Wherein the number of pixels contained in each pixel block may be different.
Furthermore, based on the macro block coding mode proposed in the video coding standard H.264/AVC, the compression processing of the image can also be realized by dividing a single frame video image into macro blocks.
Specifically, a single frame video image is divided into a plurality of macro blocks, and then each macro block is sequentially encoded, thereby realizing compression processing of the video image. That is, the compression processing is performed on a single-frame video image one by one in units of macroblocks. That is, the data to be compressed is a macroblock in a frame of image. Wherein a macroblock is composed of one luminance pixel and additionally two chrominance pixel blocks. The luminance block is a 16 × 16 pixel block, and the sizes of the two chrominance image pixel blocks are determined by the sampling format of the image.
In addition, for some simple video images, the data to be compressed can also be set as a plurality of macro blocks in one frame image. Therefore, the data to be compressed may be one pixel, a plurality of pixels, one macroblock, or a plurality of macroblocks in one frame image. In a specific implementation process, a person skilled in the art may set the size of the data to be compressed according to an actual situation, which is not specifically limited herein.
In some embodiments, the compression encoding mode of the data to be compressed may be intra-frame encoding or inter-frame encoding. Therefore, before encoding the data to be compressed, the encoding mode required by the data to be compressed needs to be judged.
The compression coding mode of the data to be compressed can be determined according to the position of the pixel in the frame image, and can also be determined according to the position of the macro block in the frame image.
Specifically, the method comprises the following steps: if the data to be compressed is a pixel in a certain frame of image, determining the compression coding mode of the pixel according to the position of the pixel in the image to which the pixel belongs. If the data to be compressed is a plurality of pixels in a certain frame of image, that is, the data to be compressed is a pixel block, the compression encoding mode of the pixel block is determined according to the position of the pixel block in the image to which the pixel block belongs.
If the data to be compressed is a macro block in a certain frame of image, the compression coding mode of the macro block is determined according to the position of the macro block in the image to which the macro block belongs. If the data to be compressed is a plurality of macro blocks in a certain frame of image, determining the compression coding modes of the macro blocks according to the positions of the macro blocks in the image to which the macro blocks belong.
Further, whether the data to be compressed needs to be subjected to the hierarchical compression processing can be determined by judging the encoding mode of the data to be compressed.
When it is determined that some data to be compressed needs to be intra-coded, the data to be compressed may be compressed in a hierarchical manner. Specifically, the hierarchical compression processing includes primary compression encoding and secondary compression encoding, and the primary compression encoding is followed by the secondary compression encoding. Wherein the primary compression encoding is inter-frame encoding and the secondary compression encoding is intra-frame encoding. The specific process of the hierarchical compression process mainly includes steps S120 to S140.
And S120, if the compression coding mode of the data to be compressed is intra-frame coding, performing inter-frame coding on the data to be compressed in advance.
In some embodiments, the data to be compressed may be inter-coded by the following steps.
And S121, calculating a motion vector between the reference data and the data to be compressed.
And S122, generating prediction data of the data to be compressed according to the reference data and the motion vector.
And S123, generating differential data according to the data to be compressed and the prediction data of the data to be compressed.
S124, Discrete Cosine Transform (DCT) is performed on the differential data to obtain differential data after DCT transformation.
And S125, quantizing the differential data after DCT transformation to obtain quantized differential data.
And S126, coding the quantized differential data to obtain data after interframe coding.
Obviously, through the above six steps S121 to S126, the primary encoding of the data to be compressed is completed. After the primary encoding is finished, the compression of the data to be compressed can be finished only by carrying out secondary compression encoding once again. Wherein, the primary coded data needs to be decoded before the secondary compression coding. That is, the obtained inter-encoded data is inter-decoded, i.e., step S130.
S130, inter-frame decoding is performed on the inter-coded data.
S140, intra-frame coding is performed again on the inter-decoded data to obtain compressed data.
In some embodiments, intra coding differs from inter coding in the way prediction data is generated, i.e., steps S121 and S122. The generation methods of prediction data in intra-frame coding mainly include two types, namely one-dimensional prediction and two-dimensional prediction. In the one-dimensional prediction, reference data is directly used as prediction data. Two-dimensional prediction is the generation of prediction data based on the reference data and the weights of the reference data.
As one example, the data to be compressed is one pixel. The one-dimensional prediction is performed by using the correlation between adjacent pixels in the same row. Since the pixel value of the current pixel is generally closer to the pixel value of the previous pixel, the pixel value of the previous pixel can be directly used as the predicted value of the current pixel in this case. And the two-dimensional prediction is performed by using the adjacent pixel point of the current row and the adjacent pixel point of the previous row. The predicted value of the current pixel is generated by assigning corresponding weighted values to the pixel values of the pixels of different rows.
In addition, when it is determined that inter-frame encoding is required for some data to be compressed, only the data to be compressed is subjected to primary compression encoding. That is, when the encoding method of a certain data to be compressed is inter-frame encoding, the data to be compressed is inter-frame encoded only once, and is not intra-frame encoded.
For the convenience of understanding, a specific example is given below to describe the data compression method in this embodiment.
A frame of image in a video sequence is divided into N macro blocks, wherein N is an integer larger than 1. The coding mode of the 2 nd macro block in the image is intra-frame coding, and the coding modes of the rest N-1 macro blocks are inter-frame coding. The present example will sequentially perform encoding in units of each macroblock, and thus complete the compression processing of the frame image.
Specifically, the method comprises the following steps: and judging the coding mode of the 1 st macro block. And after the 1 st macro block is determined to be coded in an inter-frame mode, performing inter-frame coding on the 1 st macro block, and outputting the data after the 1 st macro block is coded in an inter-frame mode.
And after confirming that the 1 st macro block is coded in the frame, continuously judging the coding mode of the 2 nd macro block. And after the 2 nd macroblock is determined to be coded in the frame, carrying out two-stage coding processing on the 2 nd macroblock.
First, inter-coding the 2 nd macroblock to generate inter-coded data of the 2 nd macroblock. Then, inter-frame decoding is performed on the data after the 2 nd macroblock is encoded, and the data after the 2 nd macroblock inter-frame decoding is obtained. And finally, carrying out intra-frame coding on the data after the 2 nd macroblock inter-frame decoding, thereby completing the coding of the 2 nd macroblock. Meanwhile, the data after the 2 nd macro block coding is output.
And after the 2 nd macro block is confirmed to be coded, continuously and sequentially judging the coding mode of each macro block after the 2 nd macro block, and sequentially and correspondingly coding each macro block after the 2 nd macro block according to the judged coding mode of each macro block. And after the N macro blocks are completely coded, the coding of the frame image is finished.
Obviously, in this embodiment, only the inter-frame encoding compression processing is performed on the data to be compressed whose encoding method is inter-frame encoding, and the inter-frame encoding and intra-frame encoding compression processing are performed on the data to be compressed whose encoding method is intra-frame encoding. Therefore, when the data to be compressed with the encoding mode of interframe encoding is compressed, only noise generated by interframe encoding is introduced; when compressing data to be compressed, the encoding method of which is intra-frame encoding, not only noise generated by intra-frame encoding but also noise generated by inter-frame encoding is introduced.
That is, the inter-frame encoding method in this embodiment only performs one inter-frame encoding process, and the intra-frame encoding method specifically performs one inter-frame encoding process and then performs one intra-frame encoding process. In this embodiment, when inter-frame coding is performed on data to be compressed, only noise generated by inter-frame coding is introduced; when the data to be compressed is subjected to intra-frame coding, not only the noise generated by the intra-frame coding but also the noise generated by the inter-frame coding can be introduced. Meanwhile, because the noise generated by the intra-frame coding is very small compared with the noise generated by the inter-frame coding, the difference between the noise generated by the intra-frame coding and the noise generated by the inter-frame coding in the embodiment is greatly reduced.
In summary, when data to be compressed in which the encoding method is intra-frame encoding and data to be compressed in which the encoding method is inter-frame encoding exist in a frame at the same time, the method of performing compression processing twice on the data to be compressed in which the encoding method is intra-frame encoding can improve the quality of an image on the premise of ensuring a certain compression ratio, thereby improving the visual effect of the image.
In some embodiments, in order to further reduce the difference between the noise generated by intra-coding and the noise generated by inter-coding, the compression ratio of intra-coding may be set to be smaller than a preset value. By setting the compression ratio of the intra-frame coding to be smaller than the preset value, the difference between the data obtained by the intra-frame coding and the data obtained by the inter-frame decoding can be smaller, namely, the noise generated by the intra-frame coding can be weakened, so that the difference between the noise generated by the intra-frame coding and the noise generated by the inter-frame coding is further reduced.
As an example, the compression ratio of intra-coding can be set to be smaller than a preset value by adjusting the quantized coefficients. The preset value can be set by a person skilled in the art according to actual conditions, and is not specifically limited herein.
The data compression method provided by the embodiment of the invention only performs interframe coding compression processing on the data to be compressed with an interframe coding mode, and performs two times of interframe coding and intraframe coding compression processing on the data to be compressed with an intraframe coding mode. Therefore, when the data to be compressed with the intra-frame coding mode is compressed, the noise generated by the inter-frame coding is introduced, so that the difference between the noise generated by the intra-frame coding and the noise generated by the inter-frame coding can be greatly reduced. Therefore, the data compression method provided by the embodiment of the invention can improve the quality of the image on the premise of ensuring the compression ratio, thereby improving the visual effect of the image.
The following describes the data compression apparatus according to an embodiment of the present invention in detail with reference to fig. 2. Fig. 2 is a schematic structural diagram illustrating a data compression apparatus according to another embodiment of the present invention. As shown in fig. 2, the apparatus 200 for compressing data includes:
the determining module 210 is configured to determine a compression encoding mode of the data to be compressed.
In some embodiments, the compression encoding mode of the data to be compressed may be intra-frame encoding or inter-frame encoding.
In some embodiments, the data to be compressed may be one or more pixels in a frame of image, and the data to be compressed may also be one or more macroblocks in a frame of image.
When the data to be compressed is one or more pixels in a frame of image, the determining module 210 is specifically configured to:
and determining the compression coding mode of the data to be compressed according to the position of the pixel in the frame image.
When the data to be compressed is a macroblock or a plurality of macroblocks in a frame of image, the determining module 210 is specifically configured to:
and determining the compression coding mode of the data to be compressed according to the position of the macro block in the frame image.
The inter-frame coding module 220 is configured to perform inter-frame coding on the data to be compressed in advance if the compression coding mode of the data to be compressed is intra-frame coding.
And an inter-frame decoding module 230, configured to perform inter-frame decoding on the inter-coded data.
And an intra-frame coding module 240, configured to perform intra-frame coding on the inter-frame decoded data again to obtain compressed data.
In some embodiments, the compression ratio of intra-coding is set to be smaller than a preset value.
Further, setting the compression ratio of intra-frame coding to be less than a preset value includes:
and setting the compression ratio of the intra-frame coding to be smaller than a preset value by adjusting the quantization coefficient.
Other details of the data compression apparatus according to the embodiment of the present invention are similar to the data compression method according to the embodiment of the present invention described above with reference to fig. 1, and are not repeated herein.
The data compression device provided by the embodiment of the invention can greatly reduce the difference between the noise generated by intra-frame coding and the noise generated by inter-frame coding, thereby improving the quality of the image and improving the visual effect of the image on the premise of ensuring the compression ratio.
The method and apparatus for compressing data according to the embodiment of the present invention described in conjunction with fig. 1 and 2 may be implemented by a device for compressing data. Fig. 3 is a diagram illustrating a hardware structure 300 of a data compression apparatus according to an embodiment of the present invention.
As shown in fig. 3, the data compression device 300 in the present embodiment includes an input device 301, an input interface 302, a central processing unit 303, a memory 304, an output interface 305, and an output device 306. The input interface 302, the central processing unit 303, the memory 304, and the output interface 305 are connected to each other via a bus 310, and the input device 301 and the output device 306 are connected to the bus 310 via the input interface 302 and the output interface 305, respectively, and further connected to other components of the data compression device 300.
Specifically, the input device 301 receives input information from the outside and transmits the input information to the central processor 303 through the input interface 302; central processor 303 processes the input information based on computer-executable instructions stored in memory 304 to generate output information, stores the output information temporarily or permanently in memory 304, and then transmits the output information to output device 306 through output interface 305; the output device 306 outputs the output information to the outside of the compression device 300 of the data for use by the user.
That is, the compression apparatus of data shown in fig. 3 may also be implemented to include: a memory storing computer-executable instructions; and a processor which, when executing computer executable instructions, may implement the method and apparatus for compression of data described in connection with fig. 1 and 2.
In one embodiment, the apparatus 300 for compressing data shown in fig. 3 includes: a memory 304 for storing programs; the processor 303 is configured to execute the program stored in the memory to perform the data compression method according to the embodiment of the present invention.
The data compression equipment provided by the embodiment of the invention can greatly reduce the difference between the noise generated by intra-frame coding and the noise generated by inter-frame coding, thereby improving the quality of the image and improving the visual effect of the image on the premise of ensuring the compression ratio.
An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium has computer program instructions stored thereon; the computer program instructions, when executed by a processor, implement a method of compressing data provided by an embodiment of the invention.
It is to be understood that the invention is not limited to the specific arrangements and instrumentality described above and shown in the drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present invention are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications and additions or change the order between the steps after comprehending the spirit of the present invention.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, Erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, Radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this patent describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
As described above, only the specific embodiments of the present invention are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present invention, and these modifications or substitutions should be covered within the scope of the present invention.

Claims (12)

1. A method of compressing data, comprising:
judging the compression coding mode of data to be compressed in a frame of image;
if the compression coding mode of the data to be compressed is intra-frame coding, inter-frame coding is carried out on the data to be compressed in advance;
inter-frame decoding is carried out on data obtained by inter-frame coding;
carrying out intraframe coding on the data obtained by interframe decoding again to obtain compressed data;
and if the compression coding mode of the data to be compressed is interframe coding, performing interframe coding on the data to be compressed to obtain compressed data.
2. The data compression method according to claim 1, wherein a compression ratio of the intra-frame coding is set to be smaller than a preset value.
3. The data compression method of claim 2, wherein setting the compression ratio of the intra-frame coding to be less than a preset value comprises:
and setting the compression ratio of the intra-frame coding to be smaller than a preset value by adjusting the quantization coefficient.
4. The method according to claim 1, wherein the data to be compressed is one or more pixels in a frame of image or one or more macroblocks in a frame of image.
5. The data compression method according to claim 4, wherein the judging the compression encoding mode of the data to be compressed comprises:
determining a compression coding mode of the data to be compressed according to the position of the pixel in the frame image; alternatively, the first and second electrodes may be,
and determining the compression coding mode of the data to be compressed according to the position of the macro block in the frame image.
6. An apparatus for compressing data, the apparatus comprising:
the judging module is used for judging the compression coding mode of the data to be compressed in one frame of image;
the inter-frame coding module is used for pre-coding the data to be compressed in an inter-frame coding mode if the compression coding mode of the data to be compressed is intra-frame coding;
the inter-frame decoding module is used for performing inter-frame decoding on the data obtained by the inter-frame coding;
the intraframe coding module is used for carrying out intraframe coding on the data obtained by interframe decoding again to obtain compressed data;
the inter-frame coding module is further configured to perform inter-frame coding on the data to be compressed to obtain compressed data if the compression coding mode of the data to be compressed is inter-frame coding.
7. The data compression apparatus according to claim 6, wherein a compression ratio of the intra-frame coding is set to be smaller than a preset value.
8. The apparatus according to claim 7, wherein the setting of the compression ratio of the intra-frame coding to be smaller than a preset value comprises:
and setting the compression ratio of the intra-frame coding to be smaller than a preset value by adjusting the quantization coefficient.
9. The apparatus according to claim 6, wherein the data to be compressed is one or more pixels in a frame of image or one or more macroblocks in a frame of image.
10. The apparatus according to claim 9, wherein the determining module is specifically configured to:
determining a compression coding mode of the data to be compressed according to the position of the pixel in the frame image; alternatively, the first and second electrodes may be,
and determining the compression coding mode of the data to be compressed according to the position of the macro block in the frame image.
11. An apparatus for compressing data, the apparatus comprising: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements a method of compression of data as claimed in any one of claims 1 to 5.
12. A computer-readable storage medium, having stored thereon computer program instructions, which when executed by a processor, implement a method of compression of data according to any one of claims 1-5.
CN201810078744.3A 2018-01-26 2018-01-26 Data compression method, device, equipment and medium Active CN110087070B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810078744.3A CN110087070B (en) 2018-01-26 2018-01-26 Data compression method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810078744.3A CN110087070B (en) 2018-01-26 2018-01-26 Data compression method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN110087070A CN110087070A (en) 2019-08-02
CN110087070B true CN110087070B (en) 2021-04-02

Family

ID=67412613

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810078744.3A Active CN110087070B (en) 2018-01-26 2018-01-26 Data compression method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN110087070B (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1845735A4 (en) * 2004-12-28 2009-07-15 Nec Corp Moving picture encoding method, and apparatus and computer program using the same
KR100727994B1 (en) * 2005-10-06 2007-06-14 삼성전자주식회사 Method for coding of moving picture frame with less flickering and apparatus therefor
KR20170084055A (en) * 2014-11-06 2017-07-19 삼성전자주식회사 Video encoding method and apparatus, video decoding method and apparatus

Also Published As

Publication number Publication date
CN110087070A (en) 2019-08-02

Similar Documents

Publication Publication Date Title
RU2765300C1 (en) Method for encoding and decoding of images, encoding and decoding device and corresponding computer programs
US8724704B2 (en) Apparatus and method for motion estimation and image processing apparatus
CN102137263B (en) Distributed video coding and decoding methods based on classification of key frames of correlation noise model (CNM)
JP4851741B2 (en) Method and apparatus for encoding a sequence of source images
CN1949877B (en) Adaptive quantization controller and method thereof
CN100553333C (en) Use the moltion estimation method of adaptive mode decision
JP2009503999A (en) Encoding device, encoding method, decoding device, decoding method, and program thereof
JP2013509063A (en) Method for coding a block of an image sequence and method for reconstructing this block
KR20050045746A (en) Method and device for motion estimation using tree-structured variable block size
KR20180078310A (en) A method for reducing real-time video noise in a coding process, a terminal, and a computer readable nonvolatile storage medium
CN101014129B (en) Video data compression method
KR20080016660A (en) Image processing of dct-based video sequences in compressed domain
KR100597397B1 (en) Method For Encording Moving Picture Using Fast Motion Estimation Algorithm, And Apparatus For The Same
JP2010130558A (en) Video encoding apparatus and video encoding method
CN101198066A (en) Frame and intraframe coding mode selection method
JP2004241957A (en) Image processor and encoding device, and methods therefor
CN115118976A (en) Image coding method, readable medium and electronic device thereof
JP4824705B2 (en) Image encoding method, image decoding method, image encoding device, image decoding device, image encoding program, image decoding program, and computer-readable recording medium recording these programs
CN113489976A (en) Predictive coding method and device and electronic equipment
CN110087070B (en) Data compression method, device, equipment and medium
JP3491001B1 (en) Signal encoding method, signal decoding method, signal encoding device, signal decoding device, signal encoding program, and signal decoding program
JP2014514808A (en) Method for reconstructing and encoding image blocks
CN101198065A (en) Frame and intraframe coding mode selection method
CN108900842B (en) Y data compression processing method, device and equipment and WebP compression system
JPH0984024A (en) Coder for moving image signal

Legal Events

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