Data processing method and system
By using gamma algorithms and spectrum adjustment technology during video data compression and decompression, the problem of difficult to balance the calculation amount and clarity in the prior art is solved, and efficient data compression and clear data decompression are achieved.
Patent Information
- Application Number
- CN202110008566.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-05
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2041-01-05
AI Technical Summary
The existing video compression technology is difficult to balance between the calculation amount and the video clarity after decompression, and there are noise problems, such as block effect and ringing effect, which affect the data transmission efficiency and the clarity after decompression.
The boundaries of the initial frame in the video data are adjusted through a small-range gamma algorithm to avoid details loss, and the initial frame is encoded and spectrum adjustment is performed to reduce the amount of data information. During the decompression process, decoding spectrum adjustment and boundary correction techniques are used to eliminate noise and improve decompression clarity.
It significantly improves the compression efficiency of data, improves the transmission efficiency of data, reduces data loss and detail loss, and eliminates noise and improves the clarity of data after decompression.
Smart Images

Figure CN114727110B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method and system for data processing. Background Art
[0002] With the increasing popularity of Internet technology, especially the popularity of mobile terminals, more and more types of data are emerging in communication networks. With the popularization of computers, more and more data are occupying more and more network and storage resources, such as video data, audio data, etc. Data often contains a huge amount of information, and the requirements for storage and transmission are often very high. Therefore, in order to facilitate storage and transmission, it is often necessary to compress the data and then decompress and restore the compressed data when necessary. Therefore, data compression and decompression technology is increasingly used.
[0003] For example, in the past few decades, video and image compression technology has been increasingly used. Videos often contain a huge amount of information. From traditional broadcast film and television to a large number of current monitoring and Internet applications, compressed video and images are taking up more and more network and storage resources. This means that if the original data of a video is transmitted from one terminal to another through the network, a large amount of network resources will be occupied. This makes it difficult to achieve smooth transmission of the picture in some real-time video transmission situations. Therefore, before the video data is transmitted, it must first be compressed at the data compression device for easy transmission. After the compressed video is transmitted to the data decompression device through the transmission medium, the data decompression device decompresses the video to at least partially restore the video image.
[0004] The main video compression standards in the prior art are H.264 and H.265 standards. Before transmission, the video is usually compressed as a whole using an encoder according to the H.264 and H.265 standards, and after transmission, the video is decompressed as a whole by a decoder according to the H.264 and H.265 standards. However, the above-mentioned processing method for compressing the video as a whole is still not satisfactory in terms of the balance between the amount of calculation and the clarity of the video after decompression. This is because the H.264 and H.265 standards generate a predicted frame of the original frame through various complex algorithms when processing the original video, and then record the residual between the original frame and the predicted frame. The closer the predicted frame is to the original frame, the smaller the residual is, and the smaller the amount of data after encoding a video. In order to make encoding easier, a common method is to reduce the high-frequency information in the original frame image by filtering the original frame. It can be seen from the Fourier transform that the frequency information of the boundary part of the object in the picture is often rich, and the high-frequency component of the boundary part is usually greater than the high-frequency component of other flat areas. Therefore, although the frame image with reduced high-frequency information becomes visually blurred (that is, the clarity of the image is reduced), the residual between the predicted frame and the filtered original frame can be made smaller. In this way, the amount of calculation required for video encoding and the encoded data flow are greatly reduced. However, the frame prediction technology is very complex and will occupy a lot of computing resources. Taking the video encoding and decoding system as an example, for every 30% to 40% increase in coding efficiency, the amount of calculation will increase by about 10 times. At the same time, the clarity of the transmitted data is reduced after decompression, and there are often various noises, such as block effect or ringing effect. The block effect refers to the phenomenon that the block-based Fourier transform causes discontinuity at the image boundary in image processing. The ringing effect refers to the phenomenon that when an image is subjected to spectrum adjustment processing in image processing, if the selected spectrum adjustment function has a rapid change in value (that is, there is an area where the derivative changes dramatically), the output image will produce grayscale oscillations at the grayscale changes dramatically, just like the air oscillations generated when a clock is struck. The noise often appears at the image boundary. If an output image has strong noise, it cannot meet people's growing demand for data clarity. Therefore, how to further improve the data compression efficiency, while improving the clarity of the decompressed data and eliminating noise has always been the goal pursued in the field of data compression and decompression technology.
[0005] Therefore, in order to improve the data transmission efficiency and the clarity of the data after decompression, a data processing method and system with higher compression efficiency and clearer data decompression is needed. Summary of the invention
[0006] The present specification provides a method and system for data processing with higher compression efficiency and clearer data decompression. Taking video data as an example, the method and system for data processing can adjust the boundaries within a small range in the initial frame of the initial video data through a small-range gamma algorithm to avoid the loss of boundary information within a small range with a small gap between adjacent pixels in the image during data compression (prediction and residual calculation) and avoid detail loss; at the same time, the method and system can adjust the encoding spectrum of the initial frame, so that the signal strength of the initial frame in the selected frequency domain is reduced, and the amplitude of the selected frequency region in the initial frame is steadily reduced, thereby reducing the amount of data information. Then, the spectrum-adjusted data is encoded (predicted and residual calculated) to obtain a compressed frame, thereby improving the efficiency of data compression. The encoding spectrum adjustment can reduce the amount of data information in the initial frame, and can improve the efficiency of data compression when predicting and calculating residuals. When decompressing data, the method and system can perform decoding spectrum adjustment and boundary correction on the compressed frame. The method and system can first decode the compressed frame, and then use the parameters corresponding to the encoding end to perform decoding spectrum adjustment on the decoded data. The decoding spectrum adjustment can filter the components of the intermediate frequency and high frequency regions in the decoded data, that is, obtain data that is more blurred than the decoded data. The decoded data is subtracted from the data filtered out of the intermediate frequency and high frequency regions after the decoding spectrum adjustment to obtain the boundary information in the initial frame; then the method and system can weaken the boundary within a small range in the boundary information through the gamma algorithm within a small range to perform the boundary correction to eliminate the noise in the boundary information; finally, the method and system superimpose the denoised boundary information with the decoded data to obtain the decompressed frame. The decoding spectrum adjustment corresponds to the encoding spectrum adjustment, and there is a corresponding relationship between the encoding spectrum adjustment function and the decoding spectrum adjustment function, which can restore the compressed data adjusted by the encoding spectrum to the clarity of the initial frame or even higher than the clarity of the initial frame. That is to say, without significantly increasing the amount of computation of encoding and decoding, the decoding end needs to at least restore the data of the decompressed data within the important frequency to the clarity of the initial frame, and can even obtain a clarity that exceeds the initial frame. Since the initial frame has only undergone signal attenuation in the frequency domain instead of filtering in the frequency domain in the important frequency region, the information in the important frequency domain is not lost, so the encoding spectrum adjustment function and the decoding spectrum adjustment function can be designed according to the relationship between the encoding spectrum adjustment function and the decoding spectrum adjustment function and their respective characteristics to restore the information on the important frequencies in the initial frame. The method and system can significantly improve the data compression efficiency, improve the data transmission efficiency, reduce data loss, avoid detail loss, eliminate noise, and improve the clarity of the decompressed data.
[0007] Based on this, in the first aspect, the present specification provides a method for data processing, comprising: selecting an initial frame in initial data, the initial frame comprising initial data of a preset number of bytes; and performing data compression on the initial frame to obtain a compressed frame, wherein the data compression comprises performing boundary adjustment on the initial frame and performing coding spectrum adjustment on the compressed frame, the compressed frame comprising the initial frame and any data state of the initial frame before becoming the compressed frame during the data compression process, wherein the coding spectrum adjustment comprises convolving the compressed frame with a coding convolution kernel so as to smoothly reduce the amplitude of the intermediate frequency region of the compressed frame in the frequency domain.
[0008] In some embodiments, the boundary adjustment includes adjusting a boundary of the initial frame whose boundary value is within a first preset range by using a first gamma algorithm whose gamma value is less than 1.
[0009] In some embodiments, the data compression of the initial frame includes: firstly performing the boundary adjustment on the initial frame and then performing the coding spectrum adjustment; or firstly performing the coding spectrum adjustment on the initial frame and then performing the boundary adjustment.
[0010] In some embodiments, the step of first performing the boundary adjustment on the initial frame and then performing the coding spectrum adjustment includes: performing the boundary adjustment on the initial frame to obtain a first enhanced frame; and performing the coding spectrum adjustment and encoding on the first enhanced frame, including one of the following methods: first performing the coding spectrum adjustment on the first enhanced frame, and then predicting and calculating the residual of the first enhanced frame after the coding spectrum adjustment, wherein the compressed frame includes the first enhanced frame; first predicting the first enhanced frame to obtain a predicted frame, and then performing the coding spectrum adjustment and calculating the residual of the first enhanced frame and the predicted frame, wherein the compressed frame includes the first enhanced frame and the predicted frame; and first predicting and calculating the residual of the first enhanced initial frame, and then performing the coding spectrum adjustment on the residual, wherein the compressed frame includes the residual.
[0011] In some embodiments, the boundary adjustment of the initial frame to obtain the first enhanced frame includes: adjusting the initial frame through a first adjustment function to obtain the first frame, so that the components of the initial frame in the low-frequency region in the frequency domain are retained and the components in the medium-frequency to high-frequency region are attenuated; subtracting the initial frame from the first frame to obtain a first boundary, wherein the first boundary includes boundary information of the initial frame; adjusting the boundary of the first boundary whose boundary value is within the first preset range through the first gamma algorithm to obtain an enhanced boundary; and superimposing the first frame with the enhanced boundary to obtain the first enhanced frame.
[0012] In some embodiments, before obtaining the enhanced boundary, performing the boundary adjustment on the initial frame to obtain the first enhanced frame also includes: enhancing the first boundary by a first coefficient, wherein the first coefficient is any number greater than 1, and the first boundary includes the boundary enhanced by the first coefficient.
[0013] In some embodiments, the boundary in the first boundary whose boundary value is within the first preset range is adjusted to obtain an enhanced boundary, including: adjusting the first boundary through a second adjustment function to obtain a second boundary, so that the component of the first boundary in the low-frequency region in the frequency domain is retained and the component in the mid-frequency to high-frequency region is attenuated; and adjusting the boundary in the second boundary whose boundary value is within the first preset range through the first gamma algorithm to obtain the enhanced boundary.
[0014] In some embodiments, the coding spectrum is first adjusted on the initial frame, and then the boundary adjustment is performed, including: performing the coding spectrum adjustment on the initial frame to obtain a coding spectrum adjusted frame; performing the boundary adjustment on the coding spectrum adjusted frame to obtain a second enhanced frame; and predicting and calculating the residual of the second enhanced frame.
[0015] In some embodiments, the boundary adjustment of the coded spectrum adjustment frame to obtain a second enhanced frame includes: subtracting the initial frame and the coded spectrum adjustment frame to obtain a first boundary, wherein the first boundary includes boundary information of the initial frame; adjusting the boundary of the first boundary whose boundary value is within the first preset range through the first gamma algorithm to obtain an enhanced boundary; subtracting the enhanced boundary from the first boundary to obtain an adjustment value; and superimposing the coded spectrum adjustment frame with the adjustment value to obtain the second enhanced frame.
[0016] In some embodiments, before obtaining the enhanced boundary, the boundary adjustment is performed on the coded spectrum adjustment frame to obtain a second enhanced frame, and further includes: enhancing the first boundary by a first coefficient, wherein the first coefficient is any number greater than 1, and the first boundary includes a boundary enhanced by the first coefficient.
[0017] In some embodiments, the boundary in the first boundary whose boundary value is within the first preset range is adjusted to obtain an enhanced boundary, including: adjusting the first boundary through a second adjustment function to obtain a second boundary, so that the component of the first boundary in the low-frequency region in the frequency domain is retained and the component in the mid-frequency to high-frequency region is attenuated; and adjusting the boundary in the second boundary whose boundary value is within the first preset range through the first gamma algorithm to obtain the enhanced boundary.
[0018] In some embodiments, the encoding spectrum adjustment of the compressed frame includes: determining a frame type of the initial frame, the frame type including at least one of an intra-frame prediction frame, a forward prediction frame, and a bidirectional prediction frame; and based on the frame type of the initial frame, selecting a convolution kernel from a coding convolution kernel group as the coding convolution kernel to convolve the compressed frame.
[0019] In some embodiments, convolving the compressed frame includes: convolving the compressed frame in at least one direction of a vertical direction, a horizontal direction, and a diagonal direction.
[0020] In some embodiments, the coding spectrum is adjusted so as to smoothly reduce the amplitude of the high frequency region of the compressed frame in the frequency domain.
[0021] In some embodiments, the coding spectrum adjustment smoothly reduces the amplitude of the low-frequency region of the compressed frame in the frequency domain, and the amplitude reduction of the low-frequency region of the compressed frame caused by the coding spectrum adjustment is lower than the amplitude reduction of the medium-frequency region.
[0022] In some embodiments, the amplitude adjustment gain of the encoded spectrum adjustment on any frequency in the frequency domain of the compressed frame is greater than zero.
[0023] In a second aspect, the present specification also provides a data processing system, comprising: at least one storage medium and at least one processor, the at least one storage medium storing at least one instruction set for data processing; the at least one processor being communicatively connected to the at least one storage medium, wherein when the system is running, the at least one processor reads the at least one instruction set and executes the data processing method described in the first aspect of this specification according to the instructions of the at least one instruction set.
[0024] In a third aspect, the present specification also provides a method for data processing, comprising: obtaining compressed data, the compressed data comprising a compressed frame obtained by compressing an initial frame; and decompressing the compressed frame to obtain a decompressed frame, the data decompression comprising decoding spectrum adjustment and boundary correction of the decompressed frame, the decompressed frame comprising the compressed frame and any data state of the compressed frame before becoming the decompressed frame during the data decompression process, wherein the decoding spectrum adjustment comprises convolving the decompressed frame with a decoding convolution kernel so that the amplitude of the decompressed frame in the frequency domain is smoothly reduced to filter components from the intermediate frequency to the high frequency region, the encoding spectrum adjustment has a preset association relationship with the decoding spectrum adjustment, and the boundary correction comprises correcting the boundary of the boundary value in the boundary of the decompressed frame within a second preset range through a second gamma algorithm to perform noise reduction.
[0025] In some embodiments, the second gamma algorithm includes a gamma algorithm with a gamma value greater than 1, so as to weaken the boundary whose boundary value is within the second preset range in the boundary of the deframing.
[0026] In some embodiments, the data decompression of the compressed frame includes: performing the decoding spectrum adjustment on the decompressed frame to obtain a decoded spectrum adjusted frame; subtracting the decompressed frame from the decoded spectrum adjusted frame to obtain a third boundary, wherein the third boundary is the boundary of the decompressed frame and includes boundary information of the initial frame; using the second gamma algorithm, weakening the boundary in the third boundary whose boundary value is within the second preset range to perform noise reduction on the third boundary to obtain a noise reduction boundary; and superimposing the noise reduction boundary and the decompressed frame to obtain the decompressed frame.
[0027] In some embodiments, before obtaining the noise reduction boundary, the data decompressing the compressed frame includes: enhancing the third boundary by a second coefficient, wherein the second coefficient is any number greater than 1, and the third boundary includes the boundary enhanced by the second coefficient.
[0028] In some embodiments, the second gamma algorithm is used to weaken the boundary in the third boundary whose boundary value is within the second preset range to reduce the noise of the third boundary and obtain a noise reduction boundary, including: adjusting the third boundary through a third adjustment function to obtain a fourth boundary, so that the component of the third boundary in the low-frequency area in the frequency domain is retained and the component in the mid-frequency to high-frequency area is filtered; and the second gamma algorithm is used to weaken the boundary in the fourth boundary whose boundary value is within the second preset range.
[0029] In some embodiments, before performing the decoding spectrum adjustment on the de-frame to obtain the decoded spectrum adjusted frame, the data decompressing the compressed frame further includes: decoding the compressed frame to obtain a decoded frame, and the de-frame includes the decoded frame.
[0030] In some embodiments, the data compression includes coding spectrum adjustment, including convolving the compressed frame with a coding convolution kernel so as to smoothly reduce the amplitude of the compressed frame in the intermediate frequency region in the frequency domain, the compressed frame including the initial frame and any data state before the initial frame becomes the compressed frame during the data compression process, wherein the decoding convolution kernel corresponds to the coding convolution kernel.
[0031] In a fourth aspect, the present specification also provides a data processing system, comprising at least one storage medium and at least one processor, wherein the at least one storage medium stores at least one instruction set for data processing; and the at least one processor is communicatively connected to the at least one storage medium, wherein when the system is running, the at least one processor reads the at least one instruction set and executes the data processing method described in the third aspect of the present specification according to the instructions of the at least one instruction set.
[0032] Other functions of the data processing methods and systems provided in this specification will be partially listed in the following description. Based on the description, the content introduced by the following figures and examples will be obvious to those of ordinary skill in the art. The creative aspects of the data processing methods, systems and storage media provided in this specification can be fully explained by practicing or using the methods, devices and combinations described in the following detailed examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1 A schematic diagram of a data processing system provided according to an embodiment of this specification is shown;
[0035] Figure 2 A schematic diagram of a data compression device for data processing provided according to an embodiment of this specification is shown;
[0036] Figure 3A A flowchart of data compression and data decompression provided according to an embodiment of this specification is shown;
[0037] Figure 3B A flowchart of data compression and data decompression provided according to an embodiment of this specification is shown;
[0038] Figure 3C A flowchart of data compression and data decompression provided according to an embodiment of this specification is shown;
[0039] Figure 3D A flowchart of data compression and data decompression provided according to an embodiment of this specification is shown;
[0040] Figure 4A A flowchart of a method for data processing for compressing data provided in accordance with an embodiment of the present specification is shown;
[0041] Figure 4B A flowchart of a method for data processing for compressing data provided in accordance with an embodiment of the present specification is shown;
[0042] Figure 4C A flowchart of a method for data processing for compressing data provided in accordance with an embodiment of the present specification is shown;
[0043] Figure 4D A flowchart of a method for data processing for compressing data provided in accordance with an embodiment of the present specification is shown;
[0044] Figure 5A A flowchart of obtaining a first enhanced frame provided according to an embodiment of this specification is shown;
[0045] Figure 5B A flow chart of performing boundary adjustment according to an embodiment of this specification is shown;
[0046] Figure 5C Another flow chart for performing boundary adjustment according to an embodiment of this specification is shown;
[0047] Figure 6 A curve diagram for obtaining a second adjustment function provided according to an embodiment of this specification is shown;
[0048] Figure 7 A graph showing a gamma algorithm provided according to an embodiment of the present specification;
[0049] Fig. 8A A curve diagram of a coding spectrum adjustment function provided according to an embodiment of this specification is shown;
[0050] Figure 8B A curve diagram of a coding spectrum adjustment function provided according to an embodiment of this specification is shown;
[0051] Fig. 9 A flowchart of obtaining a second enhanced frame provided according to an embodiment of this specification is shown;
[0052] Fig.10 A flowchart of a method for data processing of decompressing a compressed frame provided in accordance with an embodiment of the present specification is shown;
[0053] Fig.11A A flowchart of decoding spectrum adjustment and boundary correction provided according to an embodiment of this specification is shown;
[0054] Fig. 11B A flow chart of performing boundary correction according to an embodiment of this specification is shown;
[0055] Fig. 11C Another flow chart for performing boundary correction according to an embodiment of this specification is shown;
[0056] Fig. 12A A graph showing an overall adjustment function H0(f) provided according to an embodiment of the present specification is shown;
[0057] Fig. 12B A graph showing an overall adjustment function H0(f) provided according to an embodiment of the present specification is shown;
[0058] Fig. 12C A graph showing an overall adjustment function H0(f) provided according to an embodiment of the present specification is shown;
[0059] Fig.12D A graph showing an overall adjustment function H0(f) provided according to an embodiment of the present specification is shown;
[0060] Fig.12E A graph showing an overall adjustment function H0(f) provided according to an embodiment of the present specification is shown;
[0061] Fig.13A A graph showing an overall adjustment function H0(f), a coding spectrum adjustment function H1(f), and a decoding spectrum adjustment function H2(f) of a normal mode provided according to an embodiment of the present specification is shown;
[0062] Fig. 13B A graph showing an overall adjustment function H0(f), a coding spectrum adjustment function H1(f), and a decoding spectrum adjustment function H2(f) of an enhanced mode provided according to an embodiment of the present specification is shown;
[0063] Fig.14A An example diagram of a decompressed image without boundary correction provided according to an embodiment of the present specification is shown; and
[0064] Fig. 14B An example diagram of a decompressed image after boundary correction according to an embodiment of the present specification is shown. DETAILED DESCRIPTION
[0065] The following description provides specific application scenarios and requirements of this specification, with the purpose of enabling those skilled in the art to make and use the contents of this specification. Various local modifications to the disclosed embodiments will be apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of this specification. Therefore, this specification is not limited to the embodiments shown, but to the widest scope consistent with the claims.
[0066] The terms used herein are only used for the purpose of describing specific example embodiments and are not restrictive. For example, unless the context clearly indicates otherwise, as used herein, the singular forms "a", "an" and "the" may also include plural forms. When used in this specification, the terms "include", "comprise" and / or "contain" mean that the associated integers, steps, operations, elements and / or components exist, but do not exclude the existence of one or more other features, integers, steps, operations, elements, components and / or groups or that other features, integers, steps, operations, elements, components and / or groups may be added in the system / method.
[0067] In view of the following description, these and other features of the present specification, as well as the operation and function of the related elements of the structure, and the economy of the combination and manufacture of the parts can be significantly improved. Reference is made to the accompanying drawings, all of which form a part of this specification. However, it should be clearly understood that the drawings are for illustration and description purposes only and are not intended to limit the scope of this specification. It should also be understood that the drawings are not drawn to scale.
[0068] The flowcharts used in this specification illustrate the operations implemented by the system according to some embodiments in this specification. It should be clearly understood that the operations of the flowcharts may not be implemented in sequence. On the contrary, the operations may be implemented in reverse order or simultaneously. In addition, one or more other operations may be added to the flowchart. One or more operations may be removed from the flowchart.
[0069] On the one hand, this specification provides a data processing system 100 (hereinafter referred to as system 100). On the second hand, this specification describes a data processing method P200 for compressing data, and on the third hand, this specification describes a data processing method P300 for decompressing compressed frames. Data processing methods P200, P300 and system 100 can be used for data compression and decompression to improve the transmission efficiency of the data and save resources and space. The data can be non-real-time data or real-time data. From traditional broadcasting, film and television to a large number of current monitoring and Internet applications, there are various types of data. For example, the data can be non-real-time video data, audio data or image data, etc. The data can also be real-time map data, real-time sensor data, real-time video monitoring data, network monitoring data, meteorological data, aerospace data, etc. For example, the data can be map data received by an autonomous driving car from a base station during driving. This specification does not limit the specific category of the data. The data processing methods P200, P300 and system 100 described in this specification are consistent in the methods and steps taken when processing different categories of data. For the sake of convenience, this specification will describe the processing of video data as an example.
[0070] In data compression and data decompression, compression and decompression are often performed in frames. A frame is a processing unit that constitutes a data sequence. The initial data may include one or more initial frames. Each initial frame includes initial data of a preset number of bytes. In video compression, the initial data may be initial video data, and the initial frame may be a frame image in the initial video data. In traditional video compression technology, the H.264 and H.265 standards are usually used to encode the initial video data, so as to achieve the purpose of compressing the video data. The main technical means used by the H.264 and H.265 standards to encode video data is predictive coding, that is, the initial data in the video data is predicted to obtain a predicted value, and then the predicted value is subtracted from the initial value of the initial data to obtain a residual value, thereby compressing the video data. When restoring and decompressing (i.e., decoding), the initial frame can be restored by adding the residual value and the predicted value.
[0071] The data processing methods P200, P300 and system 100 provided in this specification can combine coding spectrum adjustment with encoding when performing data compression, so as to reduce the amount of data during encoding, improve the compression efficiency of video data, and enhance the transmission efficiency of video; when performing data decompression, decoding spectrum adjustment can be combined with decoding to decompress the compressed data that has undergone coding spectrum adjustment and encoding, so as to restore the decompressed data to the original data.
[0072] Figure 1 FIG. 1 is a schematic diagram of a data processing system 100 . The system 100 may include a data compression device 200 , a data decompression device 300 , and a transmission medium 120 .
[0073] The data compression device 200 may receive an initial frame in the initial data to be compressed, and compress the initial data using the data processing method P200 proposed in this specification to generate a compressed frame. The data compression device 200 may store data or instructions for executing the data processing method P200 described in this specification, and execute the data and / or instructions.
[0074] The data processing method P200 can perform data compression on the video data. The data compression can be to perform boundary adjustment on the initial frame in the video data and to perform coding spectrum adjustment and encoding on the video data. Specifically, the data processing method P200 can perform the boundary adjustment on the small-range boundary in the video data through a gamma algorithm to adjust the small-range boundary, so as to avoid the loss of the boundary with a small difference in pixel values between adjacent pixels during the encoding process, and avoid the loss of details; at the same time, the data processing method P200 can also use a method combining coding spectrum adjustment and encoding to perform data compression on the video data to obtain a compressed frame, so as to further improve the compression ratio of the video data and improve the efficiency of video transmission. Specifically, the data processing method P200 can use a gamma algorithm with a gamma value less than 1 to perform the boundary adjustment on the video data. The coding spectrum adjustment refers to adjusting the amplitude of the spectrum graph of the data to be processed. For example, the coding spectrum adjustment can attenuate the amplitude of the data to be processed in the frequency domain, thereby reducing the amount of information in the data to be processed, such as attenuating the amplitude of the data to be processed in a selected frequency region in its frequency domain, such as the amplitude of the medium frequency region, the amplitude of the high frequency region, such as the amplitude from the low frequency to the medium frequency region, and the amplitude from the medium frequency to the high frequency region, etc. It can be understood by those skilled in the art that the frequency components of the data after coding spectrum adjustment in the selected frequency region become smaller, and the amount of information in the data is reduced. Therefore, the efficiency of encoding the data after coding spectrum adjustment can be improved, and the compression ratio is improved.
[0075] The data decompression device 300 can receive a compressed frame and decompress the compressed frame using the data processing method P300 proposed in this specification to obtain a decompressed frame. The data decompression device 300 can store data or instructions for executing the data processing method P300 described in this specification and execute the data and / or instructions.
[0076] The data processing method P300 can decompress the compressed frame that has been subjected to the data compression by the data processing method P200 to restore the video data. The data decompression can be decoding spectrum adjustment and boundary correction of the compressed frame. The data processing method P300 can use a method combining decoding (i.e., restoring the compressed frame according to the residual value and the predicted value) and decoding spectrum adjustment to decompress the compressed frame to restore the data in the compressed frame. The data processing method P300 can perform decoding spectrum adjustment on the compressed data through a decoding spectrum adjustment function; obtain the boundary information of the initial frame by taking the difference between the compressed data and the decoded data; and perform the boundary correction on the boundary information through a gamma algorithm to weaken the boundary within a small range and eliminate the noise information in the boundary information; the decompressed frame can be obtained by superimposing the boundary information after the noise is eliminated with the decoded data, and the boundary correction can eliminate the noise information, so that the clarity of the decompressed frame is higher. Specifically, the decoding spectrum adjustment filters the components of the intermediate frequency and high frequency regions in the decoded data by using a low-pass filter with a smooth transition, so that the decoded data can effectively avoid the ringing effect, thereby making the decompressed data clearer. The decoding spectrum adjustment can completely restore or approximately restore the data after the coding spectrum adjustment to the state before the coding spectrum adjustment without considering other calculation errors, or even surpass the state before the coding spectrum adjustment.
[0077] Therefore, the data processing methods P200, P300 and the system 100 can significantly improve the compression efficiency of video data, reduce data loss during video data compression, improve the transmission efficiency and restoration rate of the video, and the clarity of the decompressed video, and reduce the noise in the decompressed video. The specific process of the encoding spectrum adjustment and the boundary correction and the decoding spectrum adjustment and the boundary correction will be described in detail in the following description.
[0078] The data compression apparatus 200 and the data decompression apparatus 300 may include a wide range of devices. For example, the data compression apparatus 200 and the data decompression apparatus 300 may include a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet computer, a set-top box, a handheld device such as a smart phone, a television, a camera, a display device, a digital media player, a video game console, a car computer, or the like.
[0079] like Figure 1As shown, the data compression device 200 and the data decompression device 300 can be connected via a transmission medium 120. The transmission medium 120 can facilitate the transmission of information and / or data. The transmission medium 120 can be any data carrier that can transmit compressed frames from the data compression device 200 to the data decompression device 300. For example, the transmission medium 120 can be a storage medium (e.g., an optical disk), a wired or wireless communication medium. The communication medium can be a network. In some embodiments, the transmission medium 120 can be any type of wired or wireless network, or a combination thereof. For example, the transmission medium 120 can include a cable network, a wired network, an optical fiber network, a telecommunications network, an intranet, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a wide area network (WAN), a public switched telephone network (PSTN), a Bluetooth network, a ZigBee network, a near field communication (NFC) network, or a similar network. One or more components in the data decompression device 300 and the data compression device 200 can be connected to the transmission medium 120 to transmit data and / or information. The transmission medium 120 may include a router, a switch, a base station, or other devices that facilitate communication from the data compression device 200 to the data decompression device 300. In other embodiments, the transmission medium 120 may be a storage medium, such as a mass storage, a removable storage, a volatile read-write memory, a read-only memory (ROM), or the like, or any combination thereof. Exemplary mass storage may include non-transitory storage mediums such as disks, optical disks, and solid-state drives. Removable storage may include flash drives, floppy disks, optical disks, memory cards, zip disks, tapes, and the like. Typical volatile read-write memory may include random access memory (RAM). RAM may include dynamic RAM (DRAM), dual date rate synchronous dynamic RAM (DDRSDRAM), static RAM (SRAM), thyristor RAM (T-RAM), and zero capacitance RAM (Z-RAM), and the like. ROM may include mask ROM (MROM), programmable ROM (PROM), virtual programmable ROM (PEROM), electronically programmable ROM (EEPROM), compact disk (CD-ROM), and digital versatile disk ROM, and the like. In some embodiments, the transmission medium 120 may be a cloud platform. As an example only, the cloud platform may include private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, cloud-to-cloud, or similar forms, or any combination of the above forms.
[0080] like Figure 1As shown, the data compression device 200 receives the initial data and executes the instructions of the data processing method P200 described in this specification to compress the initial data and generate a compressed frame; the compressed frame is transmitted to the data decompression device 300 via the transmission medium 120; the data decompression device 300 executes the instructions of the data processing method P300 described in this specification to decompress the compressed frame and obtain a decompressed frame.
[0081] Figure 2 Schematic diagram of a data compression device 200 for data processing is shown. The data compression device 200 can execute the data processing method P200 described in this specification. The data processing method P200 is introduced in other parts of this specification. For example, in FIG. 4A to FIG. 9 The data processing method P200 is introduced in the description.
[0082] like Figure 2 As shown, the data compression device 200 includes at least one storage medium 230 and at least one compression-end processor 220. In some embodiments, the data compression device 200 may further include a communication port 250 and an internal communication bus 210. Meanwhile, the data compression device 200 may further include an I / O component 260.
[0083] The internal communication bus 210 can connect different system components, including the storage medium 230 and the compression-side processor 220 .
[0084] The I / O component 260 supports input / output between the data compression device 200 and other components.
[0085] The storage medium 230 may include a data storage device. The data storage device may be a non-temporary storage medium or a temporary storage medium. For example, the data storage device may include one or more of a disk 232, a read-only storage medium (ROM) 234, or a random access storage medium (RAM) 236. The storage medium 230 also includes at least one instruction set stored in the data storage device. The instruction is a computer program code, and the computer program code may include a program, a routine, an object, a component, a data structure, a process, a module, etc. for executing the data processing method provided in this specification.
[0086] The communication port 250 is used for data communication between the data compression device 200 and the outside world. For example, the data compression device 200 can be connected to the transmission medium 120 through the communication port 250 .
[0087] At least one compression-side processor 220 is communicatively connected to at least one storage medium 230 via an internal communication bus 210. At least one compression-side processor 220 is used to execute the above-mentioned at least one instruction set. When the system 100 is running, at least one compression-side processor 220 reads the at least one instruction set and executes the data processing method P200 according to the instructions of the at least one instruction set. The compression-side processor 220 can execute all the steps included in the data processing method P200. The compression-side processor 220 can be in the form of one or more processors. In some embodiments, the compression-side processor 220 can include one or more hardware processors, such as a microcontroller, a microprocessor, a reduced instruction set computer (RISC), an application-specific integrated circuit (ASIC), an application-specific instruction set processor (ASIP), a central processing unit (CPU), a graphics processing unit (GPU), a physical processing unit (PPU), a microcontroller unit, a digital signal processor (DSP), a field programmable gate array (FPGA), an advanced RISC machine (ARM), a programmable logic device (PLD), any circuit or processor capable of performing one or more functions, etc., or any combination thereof. For the purpose of illustration only, only one compression-end processor 220 is described in the data compression device 200 in this specification. However, it should be noted that the data compression device 200 in this specification may also include multiple processors, and therefore, the operations and / or method steps disclosed in this specification may be performed by one processor as described in this specification, or may be performed jointly by multiple processors. For example, if the compression-end processor 220 of the data compression device 200 in this specification performs step A and step B, it should be understood that step A and step B may also be performed jointly or separately by two different compression-end processors 220 (for example, the first processor performs step A, the second processor performs step B, or the first and second processors perform steps A and B together).
[0088] Although the above structure describes the data compression device 200, this structure is also applicable to the data decompression device 300. The data decompression device 300 can execute the data processing method P300 described in this specification. The data processing method P300 is introduced in other parts of this specification. For example, in Figures 10 to 14B The data processing method P300 is introduced in the description.
[0089] When the system 100 compresses the video data, the order of the coding spectrum adjustment and the coding can be interchangeable or cross-performed. The boundary adjustment can be performed before or after the coding spectrum adjustment. Similarly, when the system 100 decompresses the compressed frame, the order of the decoding spectrum adjustment and the decoding can be interchangeable or cross-performed. It should be noted that, in order to ensure that the decompressed data information can restore the information in the initial data, the order of the decoding spectrum adjustment and the decoding in the data decompression should correspond to the order of the coding spectrum adjustment and the encoding in the data compression, that is, the decoding spectrum adjustment and the decoding can be symmetrically reversed to the coding spectrum adjustment and the encoding. For example, if the compressed frame is obtained by first performing the coding spectrum adjustment and then performing the encoding, then the compressed frame should first perform the decoding and then perform the decoding spectrum adjustment when the data is decompressed. For the convenience of description, we define the data in the initial frame before data compression processing as P0, define the encoding spectrum adjustment function corresponding to the encoding spectrum adjustment as H1(f), define the data in the decompressed frame obtained by decompression by the data decompression device 300 as P4, and define the decoding spectrum adjustment function corresponding to the decoding spectrum adjustment as H2(f).
[0090] In the data processing method P200, when the data compression device 200 compresses the data on the initial frame, it may first perform the boundary adjustment on the initial frame and then perform the coding spectrum adjustment; it may also first perform the coding spectrum adjustment on the initial frame and then perform the boundary adjustment. FIG. 3A to FIG. 3D 1 shows some data compression and data decompression flow charts provided according to the embodiments of this specification. FIG. 3A to FIG. 3C In the flowchart of data compression and data decompression shown, the data compression device 200 first performs the boundary adjustment on the initial frame, and then performs the coding spectrum adjustment. Figure 3D In the flowchart of data compression and data decompression shown, the data compression device 200 first performs the coding spectrum adjustment on the initial frame, and then performs the boundary adjustment.
[0091] Figure 3A FIG. 2 shows a flow chart of data compression and data decompression provided according to an embodiment of this specification. Figure 3AAs shown, the data compression device 200 performs data compression on the initial data as follows: the data compression device 200 first performs the boundary adjustment on the boundary of the initial frame P0 to obtain the first enhanced frame. For the convenience of description, we define the data in the first enhanced frame as P′0; then the coding spectrum adjustment and encoding are performed on the first enhanced frame P′0. Among them, the coding spectrum adjustment and encoding of the first enhanced frame P′0 can be: the data compression device 200 uses the coding spectrum adjustment function H1(f) to first perform the coding spectrum adjustment on the first enhanced frame P′0, and then perform the encoding on the first enhanced frame P′0 after the coding spectrum adjustment, that is, the first enhanced frame P′0 after the coding spectrum adjustment is predicted and the residual is calculated to obtain the predicted data PI and the residual data R, and the predicted data PI and the residual data R are input into the code stream generation module for synthesis to obtain the compressed frame. For the convenience of display, we define the data obtained after the coding spectrum adjustment by the coding spectrum adjustment function H1(f) as P1. The content of the boundary adjustment and the coding spectrum adjustment will be described in detail in the following description. Figure 3A The data compression method shown can improve coding efficiency, further reduce the amount of data in the compressed frame, and improve the compression ratio. At the same time, it can reduce data loss and avoid detail loss.
[0092] like Figure 3A As shown, the data decompression device 300 performs data decompression on the compressed frame as follows: the data decompression device 300 first performs the decoding on the compressed frame, that is, the compressed frame is parsed based on the code stream parsing module to generate the predicted data PI and the residual data R; then the predicted frame is predicted based on the predicted data PI, and is superimposed with the residual data R to obtain a decoded frame. For the convenience of description, we define the data in the decoded frame as P2. Then, the decoded frame P2 is subjected to the decoding spectrum adjustment and the boundary correction using the decoding spectrum adjustment function H2(f), and the decoded frame and the data after the boundary correction are superimposed to obtain the decompressed frame P4 for output. The specific contents of the decoding spectrum adjustment and the boundary correction will be described in detail in the following description.
[0093] For the convenience of presentation, we define the transfer function between the decompressed frame P4 and the initial data P0 as the overall spectrum adjustment function H0(f). Figure 3A The method shown can reduce the amount of data in the compressed frame, thereby improving the compression ratio and encoding efficiency of the initial data, improving the transmission efficiency of the initial data, and at the same time reducing data loss and avoiding detail loss.
[0094] The data compression device 200 may also compress the initial data by integrating the coding spectrum adjustment into the coding process. The coding spectrum adjustment may be performed at any stage of the coding process. Correspondingly, the decoding spectrum adjustment may also be performed at a corresponding stage of the decoding process.
[0095] Figure 3B FIG. 2 shows a flow chart of data compression and data decompression provided according to an embodiment of this specification. Figure 3B As shown, the data compression device 200 performs data compression on the initial data in the following manner: the data compression device 200 first performs the boundary adjustment on the boundary of the initial frame P0 to obtain the first enhanced frame P′0; and then performs the coding spectrum adjustment and the coding on the first enhanced frame P′0. Among them, the coding spectrum adjustment and the coding on the first enhanced frame P′0 may be: the data compression device 200 predicts the first enhanced frame P′0 to obtain a predicted frame and predicted data PI, and then uses the coding spectrum adjustment function H1(f) to perform the coding spectrum adjustment on the predicted frame and the first enhanced frame P′0 respectively, and then calculates the residual to obtain the residual data R, and inputs the predicted data PI and the residual data R into the bitstream generation module for synthesis to generate the compressed frame. Figure 3B The specific operation of data compression shown is Figure 3A The methods shown are the same, but the operation sequence is different. The boundary adjustment and the coding spectrum adjustment will be described in detail in the following description.
[0096] like Figure 3B As shown, the data decompression device 300 decompresses the compressed frame as follows: the data decompression device 300 parses the compressed frame based on the code stream parsing module to generate the predicted data PI and the residual data R1; the residual data R1 is subjected to the decoded spectrum adjustment function H2(f), the residual data R1 and the data subjected to the decoded spectrum adjustment are subtracted to obtain the boundary of the residual data R1, and the residual data R1 is superimposed with the subtracted data (the boundary of the residual data R1) to obtain the residual data R; then, a predicted frame is obtained according to the predicted data PI, and the predicted frame is superimposed with the residual data R to obtain a superimposed frame; then, the boundary correction is performed on the boundary in the superimposed frame, and the data subjected to the boundary correction is output as the decompressed frame P4. For the convenience of description, we define the data in the superimposed frame as P3. Specifically, the specific process of performing the boundary correction on the boundary in the superimposed frame P3 will be described in detail in the following content.
[0097] Figure 3BThe method shown can reduce the amount of data in the compressed frame, thereby improving the compression ratio and encoding efficiency of the initial data, improving the transmission efficiency of the initial data, and at the same time reducing data loss and avoiding detail loss.
[0098] Figure 3C FIG. 2 shows a flow chart of data compression and data decompression provided according to an embodiment of this specification. Figure 3C As shown, the data compression device 200 performs data compression on the initial data in the following manner: the data compression device 200 first performs the boundary adjustment on the boundary of the initial frame P0 to obtain the first enhanced frame P′0; and then performs the coding spectrum adjustment and the coding on the first enhanced frame P′0. Wherein, the coding spectrum adjustment and the coding on the first enhanced frame P′0 may be: the data compression device 200 first performs the coding on the first enhanced frame P′0, i.e., predicts and calculates the residual to obtain the predicted data PI and the residual data R, and then performs the coding spectrum adjustment on the residual data R using the coding spectrum adjustment function H1(f); the residual data R1 and the predicted data PI after the coding spectrum adjustment are input into the bitstream generation module for synthesis to generate the compressed frame. Figure 3C The specific operation of the data compression method shown is similar to Figure 3A The methods shown are the same, but the operation sequence is different. The boundary adjustment and the coding spectrum adjustment will be described in detail in the following description.
[0099] like Figure 3C As shown, the data decompression device 300 decompresses the compressed frame as follows: the data decompression device 300 parses the compressed frame based on the code stream parsing module to generate the predicted data PI and the residual data R1; the residual data R1 is subjected to the decoded spectrum adjustment function H2(f), and the residual data R1 and the data subjected to the decoded spectrum adjustment are subtracted to obtain the boundary of the residual data R1, and the residual data R1 is superimposed with the subtracted data (the boundary of the residual data R1) to obtain the residual data R; then, a predicted frame is obtained according to the predicted data PI, and the predicted frame is superimposed with the residual data R to obtain the superimposed frame P3; then, the boundary in the superimposed frame is subjected to the boundary correction, and the data subjected to the boundary correction is output as the decompressed frame P4. Specifically, the specific process of performing the boundary correction on the boundary in the superimposed frame P3 will be described in detail in the following content.
[0100] Figure 3C The method shown can reduce the amount of data in the compressed frame, thereby improving the compression ratio and encoding efficiency of the initial data, improving the transmission efficiency of the initial data, and at the same time reducing data loss and avoiding detail loss.
[0101] Figure 3D FIG. 2 shows a flow chart of data compression and data decompression provided according to an embodiment of this specification. Figure 3D As shown, the data compression device 200 performs data compression on the initial data in the following manner: the data compression device 200 first uses the coding spectrum adjustment function H1(f) to perform the coding spectrum adjustment on the initial frame P0, and then performs the boundary adjustment to obtain data P′1; then the data P′1 is encoded, that is, the data P′1 is predicted and residual is calculated to obtain predicted data PI and residual data R, and the predicted data PI and the residual data R are input into the bit stream generation module for synthesis to obtain the compressed frame. The boundary adjustment and the coding spectrum adjustment will be described in detail in the following description. Figure 3D The data compression method shown can improve coding efficiency, further reduce the amount of data in the compressed frame, and improve the compression ratio. At the same time, it can reduce data loss and avoid detail loss.
[0102] like Figure 3D As shown, the data decompression device 300 performs data decompression on the compressed frame as follows: the data decompression device 300 first performs the decoding on the compressed frame, that is, the compressed frame is parsed based on the code stream parsing module to generate the predicted data PI and the residual data R; then the predicted frame is predicted based on the predicted data PI, and is superimposed with the residual data R to obtain a decoded frame. For the convenience of description, we define the data in the decoded frame as P2. Then, the decoded frame P2 is subjected to the decoding spectrum adjustment and the boundary correction using the decoding spectrum adjustment function H2(f), and the decoded frame and the data after the boundary correction are superimposed to obtain the decompressed frame P4 for output. The specific contents of the decoding spectrum adjustment and the boundary correction will be described in detail in the following description.
[0103] Figure 3D The method shown can reduce the amount of data in the compressed frame, thereby improving the compression ratio and encoding efficiency of the initial data, improving the transmission efficiency of the initial data, and reducing data loss and avoiding detail loss. The specific process of data compression and data decompression will be described in detail in the following content.
[0104] 4A to 4DA flowchart of a method P200 for compressing data provided according to some embodiments of the present specification is shown. As mentioned above, the data compression device 200 can execute the data processing method P200. Specifically, the storage medium in the data compression device 200 can store at least one set of instruction sets. The instruction set is configured to instruct the compression processor 220 in the data compression device 200 to complete the data processing method P200. When the data compression device 200 is running, the compression processor 220 can read the instruction set and execute the data processing method P200.
[0105] The data processing method P200 may be Figure 4A The data processing method PA200 shown can also be Figure 4B The data processing method PB200 shown can also be Figure 4C The data processing method PC200 shown can also be Figure 4D The data processing method PD200 shown. Figure 4A The data processing method shown in PA200 is Figure 3A The flowchart shown corresponds to the following. Figure 4B The data processing method shown in PB200 is Figure 3B The flowchart shown corresponds to the following. Figure 4C The data processing method shown in PC200 is Figure 3C The flowchart shown corresponds to the following. Figure 4D The data processing method PD200 is shown with Figure 3D The flowchart shown corresponds to the following.
[0106] like Figure 4A As shown, the method PA200 may include:
[0107] SA220: Select the initial frame in the initial data.
[0108] A frame is a processing unit that constitutes a data sequence. When processing data, calculations are often performed in frames. The initial data may include one or more initial frames. The initial frame includes initial data of a preset number of bytes. As mentioned above, in this specification, video data is used as an example for description, so the initial data may be initial video data, and the initial frame may be a frame image in the initial video data. In step SA220, the data compression device 200 may select a portion of frame images from the initial data as the initial frame, or may select all frame images in the initial data as the initial frame. The data compression device 200 may select the initial frame according to the application scenario of the initial data. If the initial data is applied in a scenario where the accuracy and compression quality are not required to be high, some frame images may be selected as the initial frame. For example, in most cases, the surveillance image of a secluded place has no foreign objects in the picture, so most frame images of the surveillance image of the secluded place are the same, and the data compression device 200 may select some frame images from them as the initial frame for compression and transmission. For another example, for a high-definition television video, in order to ensure the viewing effect, the data compression device 200 can select all frame images as the initial frames for compression and transmission.
[0109] SA240: Perform the data compression on the initial frame to obtain a compressed frame.
[0110] The data compression may include performing the boundary adjustment on the initial frame and performing the coding spectrum adjustment on the compressed frame. The boundary adjustment on the initial frame may be adjusting a boundary whose boundary value is within a first preset range in the boundary of the initial frame by a first gamma algorithm.
[0111] The coding spectrum adjustment of the compressed frame may be inputting the compressed frame into a coding spectrum adjuster for coding spectrum adjustment. The coding spectrum adjustment refers to adjusting the amplitude of the spectrum graph of the compressed frame. For example, the coding spectrum adjustment may be performed by an attenuator. The attenuator may attenuate the amplitude of the compressed frame in the frequency domain, thereby reducing the amount of data information in the compressed frame.
[0112] The attenuator may be configured to reduce the amplitude of a selected region of the compressed frame in its frequency domain, such as the amplitude of the intermediate frequency region, the amplitude of the high frequency region, the amplitude of the low frequency to intermediate frequency region, the amplitude of the intermediate frequency to high frequency region, and so on. For different forms of data, the receiver has different sensitivities to frequency, so the data compression operation may select different regions in the frequency domain for amplitude attenuation according to different forms of data. As mentioned above, taking video data as an example, since the edge of the object in the picture is rich in intermediate frequency and high frequency information, and the intermediate frequency and high frequency regions carry more data, reducing the amplitude of the intermediate frequency to high frequency region will visually blur the boundary data of the compressed frame, and will also greatly reduce the amount of information in the image. It should be noted that reducing the amplitude of the low frequency region will also reduce the amount of information in the image. It can be understood by those skilled in the art that, compared with the case where the coding spectrum adjustment process is not performed, the frequency component of the low frequency to high frequency region in the intermediate state frame after the coding spectrum adjustment process is reduced, and the amount of data information is also reduced, so the intermediate state frame after the coding spectrum adjustment process will have a higher compression ratio in encoding. Different types of data may have different definitions for low frequency, medium frequency and high frequency areas. In some embodiments, the high frequency may include frequencies between (0.33, 0.5] in the normalized frequency domain. For example, the high frequency may include the interval between any two frequencies of 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.4, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.5 in the normalized frequency domain, where 0.5 is the maximum frequency of the normalization.
[0113] Taking video data compression as an example, the data processing method P200 can use a method that combines coding spectrum adjustment and coding to compress the initial frame, so that the amplitude of the intermediate frequency area is steadily reduced to reduce the amount of data information, further improve the compression ratio of video data, and improve the efficiency of video transmission. The compressed frame may include the initial frame and any data state of the initial frame before it is called the compressed frame in the data compression process, such as any data state of the initial frame in the process of coding spectrum adjustment and coding, for example, the initial frame, the predicted frame, the residual frame, etc. Figure 3A and Figure 4A In the embodiment, the compressed frame may be the initial frame.
[0114] Step SA240 may be to first perform the boundary adjustment on the initial frame and then perform the coding spectrum adjustment. Specifically, step SA240 may include:
[0115] SA242: Perform the boundary adjustment on the initial frame P0 to obtain the first enhanced frame P0′ .
[0116] For an image data or video data, after the coding spectrum adjustment, the image or video may become blurred, the amount of data information in the image or video data becomes smaller, and the difference between adjacent pixels becomes smaller. When the image data or video data is encoded using the standard H.264 / H.265, some image and video details may be lost to a certain extent. That is to say, the boundaries with small differences between adjacent pixels may become smaller or even disappear after the coding process, resulting in detail loss in the image data or video data. Therefore, in order to avoid the loss of boundaries with small differences between adjacent pixels during the coding and decoding process, it is necessary to perform the boundary adjustment on the boundaries with small differences between adjacent pixels to enhance the boundaries, so that the details can still be retained after coding and decoding. For those boundaries with large differences between adjacent pixels, even after the coding spectrum adjustment process, the retained boundaries are still large enough. They will not disappear after coding and decoding. Therefore, boundary adjustment can be omitted for those boundaries with large differences between adjacent pixels.
[0117] Figure 5A FIG. 4 shows a flow chart of obtaining a first enhanced frame according to an embodiment of the present specification. Figure 4A and Figure 5A As shown, step SA242 may include:
[0118] SA242-2: Through the first adjustment function H L1 (f) Adjusting the initial frame P0 to obtain the first frame.
[0119] For the convenience of description, we define the data in the first frame as P L1 The first adjustment function H L1 (f) In the frequency domain, a low-pass filter can be used to smoothly reduce the amplitude of the initial frame P0 in the frequency domain, so that the low-frequency component of the initial frame P0 in the frequency domain is retained and the component from the intermediate frequency to the high frequency region is attenuated, thereby obtaining the first frame P L1 The first frame P L1 is a blurred image. The first adjustment function H L1 (f) can be any form of smooth transition low-pass filter, which is not limited in this specification.
[0120] SA242-4: For the initial frame P0 and the first frame P L1 Take the difference and get the first boundary.
[0121] For the convenience of description, we define the data in the first boundary as PE1 The first boundary P E1 The first boundary P E1 It can be expressed as the following formula:
[0122] P E1 =P0-P L1 =P0-P0*H L1 (f) Formula (1)
[0123] The intermediate frequency to high frequency components in each frame of data spectrum are mainly concentrated in the area where the data in this frame of data changes dramatically, that is, the boundary data of the data. For example, for a frame of image, the intermediate frequency to high frequency data are mainly concentrated at the boundary of the object in the image, that is, the boundary data of this frame of image. The first adjustment function H L1 (f) The amplitude of the initial frame P0 in the frequency domain is smoothly reduced to attenuate the components in the intermediate frequency to high frequency region. L1 It can be understood that the data of the boundary information in the initial frame P0 is removed. Next, the initial frame P0 and the first frame P L1 By taking the difference, we can get the boundary of the initial frame P0, that is, the first boundary P E1 .
[0124] In some embodiments, step SA242 may further include:
[0125] SA242-6: The first boundary P is adjusted by the first coefficient a E1 Make enhancements.
[0126] Wherein, the first coefficient a is any number greater than 1. In some embodiments, the first boundary P E1 It can be the initial frame P0 and the first frame P L1 In some other embodiments, the first boundary P E1 It may be a boundary enhanced by the first coefficient a. In this case, the first boundary P E1 It can also be expressed as the following formula:
[0127] P E1 =a*(P0-P L1 )=a*(P0-P0*H L1 (f)) Formula (2)
[0128] As mentioned above, when the boundary adjustment is performed on the boundary of the initial frame, the boundary adjustment is performed only on the boundary with the smaller difference between adjacent pixels. In order to avoid the boundary adjustment affecting other boundaries that do not need to be adjusted, the data compression device 200 may first adjust the first boundary PE1 The signal is amplified by a first factor a greater than 1.
[0129] SA242-8: Using the first gamma algorithm, calculate the P E1 The boundary value is within the first preset range and is adjusted to obtain an enhanced boundary.
[0130] For the convenience of description, we define the data in the enhanced boundary as P E As mentioned above, when the boundary adjustment is performed on the boundary of the initial frame, the boundary adjustment is performed only on the boundary with the smaller difference between adjacent pixels. The first preset range may be the boundary value for which the boundary adjustment is required. The boundary value may be the boundary value of the first boundary. E1 The value corresponding to each pixel in . Specifically, the first preset range may be a range between [-R1, R1]. R1 may be a boundary threshold. For example, R1 may be 30, 40, 50, etc. In some embodiments, R1 may be any number between 5 and 30.
[0131] Figure 5B FIG. 2 shows a flow chart of performing the boundary adjustment according to an embodiment of the present specification. Figure 5B As shown, step SA242-8 may be: the data compression device 200 uses the second adjustment function H L2 (f) For the first boundary P E1 Adjust to get the second boundary P E2 ; Through the first gamma algorithm, the second boundary P E2 The boundary value in is within the first preset range [-R1, R1], and the enhanced boundary P is obtained. E .
[0132] The boundary of the initial frame (the first boundary P E1 ) contains more components in the intermediate frequency to high frequency region in the boundary that does not need the boundary enhancement. Therefore, in order to avoid the boundary enhancement affecting other boundaries that do not need to be adjusted, the data compression device 200 can first adjust the first boundary P E1 Filtering is performed to filter the components in the mid-frequency to high-frequency region. The second adjustment function H L2 (f) may be a low-pass filter with a DC component equal to 1, so that the first boundary P E1 The components in the low frequency region in the frequency domain are retained while the components in the mid to high frequency region are filtered.
[0133] Figure 6 A second adjustment function H provided according to an embodiment of the present invention is shown. L2(f) Schematic diagram. The horizontal axis is the normalized frequency f, and the vertical axis is the second adjustment function H L2 (f) Amplitude adjustment gain H L2 The normalized frequency f of the horizontal axis can be divided into a low frequency region, a mid-low frequency region, a mid-frequency region, a mid-high frequency region and a high frequency region. Figure 6 As shown, the maximum value of the normalized frequency of the horizontal axis is 0.5. As mentioned above, the high-frequency region may include frequencies between (d, 0.5] in the normalized frequency domain. Wherein d is the lower frequency limit of the high-frequency region. For example, d may be any one of 0.35, 0.36, 0.37, 0.38, 0.39, 0.4, 0.41, 0.42, 0.43, 0.44, and 0.45 in the normalized frequency domain. The intermediate frequency region may include frequencies between (b, c], where b is the lower frequency limit of the intermediate frequency region, and c is the upper frequency limit of the intermediate frequency region. For example, the lower frequency limit b of the intermediate frequency region may be any one of 0.15, 0.16, 0.17, 0.18, 0.19, 0.2, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27 and 0.28 in the normalized frequency domain. A frequency; the upper frequency limit c of the intermediate frequency region can be any one of 0.35, 0.34, 0.33, 0.32 and 0.31 in the normalized frequency domain. The low frequency region can include frequencies between [0, a] in the normalized frequency domain. Wherein a is the upper frequency limit of the low frequency region. The upper frequency limit a of the low frequency region can be any one of 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.12, 0.13, 0.14 and 0.15 in the normalized frequency domain. When the low frequency region is not connected to the intermediate frequency region, the frequency region between the two is called the intermediate-low frequency region. When the intermediate frequency region is not connected to the high frequency region, the frequency region between the two is called the intermediate-high frequency region.
[0134] The second adjustment function H L2 (f) The components in the mid-frequency to high-frequency region can be filtered. The second adjustment function H L2 The stopband interval in (f) can be any interval between the frequencies 0.25 and 0.50. For example, the second adjustment function H L2 The stopband interval in (f) can be within the interval specified by any two of the values 0.25, 0.27, 0.29, 0.31, 0.33, 0.35, 0.37, 0.39, 0.41, 0.43, 0.45 and 0.50. The second adjustment function H L2 The passband interval in (f) can be any interval between the frequency 0 and 0.35. For example, the second adjustment function HL2 The passband interval in (f) can be within the interval specified by any two of the values 0, 0.02, 0.04, 0.06, 0.08, 0.10, 0.12, 0.14, 0.15, 0.17, 0.19, 0.21, 0.23, 0.25, 0.27, 0.29, 0.21, 0.23 and 0.35.
[0135] Figure 7 FIG. 1 is a graph diagram of a gamma algorithm provided according to an embodiment of the present specification. The gamma algorithm is a nonlinear method for adjusting brightness of images and videos. The normalized function curve is as follows: Figure 7 The gamma algorithm is an algorithm for dynamically adjusting the pixel values of an image. Figure 7 As shown, the horizontal axis is the value before adjustment by the gamma algorithm, and the vertical axis is the value after adjustment by the gamma algorithm. Among them, curve 7 represents the curve with gamma value γ>1. Curve 8 represents the curve with gamma value γ=1. Curve 9 represents the curve with γ<1. When γ>1, the absolute value of the overall gray value of the image becomes smaller after the image is corrected by the gamma algorithm. When γ<1, the absolute value of the overall gray value of the image becomes larger after the image is corrected by the gamma algorithm. Figure 7 The gamma algorithm shown is an extended gamma algorithm, that is, the gamma algorithm is centrally symmetrically extended to the third quadrant with the origin (0, 0) as the symmetry point.
[0136] In step SA242-8, the data compression device 200 may perform boundary correction on the boundary of the initial frame using the first gamma algorithm. E2 Specifically, the data compression device 200 can adjust the second boundary P E2 The boundary value corresponding to each pixel in is compared with the boundary threshold R1; when the boundary value is within [-R1, R1], the boundary value is adjusted using the first gamma algorithm; when the boundary value is outside [-R1, R1], no adjustment is performed.
[0137] In some embodiments, the data compression device 200 may use the first gamma algorithm to compress the second boundary P E2 The first gamma algorithm may be a gamma algorithm with a gamma value γ<1. The data compression device 200 may adjust the second boundary P E2 Specifically, the data compression device 200 can enhance the second boundary P E2The boundary value corresponding to each pixel in is compared with the boundary threshold R1; when the boundary value is within [-R1, R1], the first gamma algorithm is used to enhance the boundary value to increase the absolute value of the boundary value; when the boundary value is outside [-R1, R1], no enhancement is performed. The data compression device 200 can use a table lookup method to perform the boundary adjustment. Table 1 can be stored in the data compression device 200. Table 1 stores the correspondence between the input boundary value and the output boundary value in the first gamma algorithm, that is, the correspondence between the boundary value before adjustment and the boundary value after adjustment. Taking R1=5 as an example, Table 1 can be expressed as:
[0138]
[0139] In some embodiments, the data compression device 200 may further use the first gamma algorithm to calculate the second boundary P E2 Boundary adjustment is performed to weaken the boundary to reduce noise. At this time, the first gamma algorithm may be a gamma algorithm with a gamma value γ>1. Specifically, the data compression device 200 may use a gamma algorithm with a gamma value γ>1 to adjust the second boundary P E2 The boundary in the first preset range [-R1, R1] is weakened to reduce the absolute value of the boundary value, thereby eliminating the second boundary P E2 The noise in the image is mostly present in the places where the boundary value is small. The boundary in the first preset range [-R1, R1] is weakened to effectively eliminate the noise.
[0140] In some embodiments, the data compression device 200 may use the first gamma algorithm to calculate the second boundary P E2 Boundary adjustment is performed to simultaneously adjust the second boundary P E2 The boundary enhancement and the boundary weakening are performed to obtain an enhanced and noise-reduced image, which can be used for preprocessing before image compression to obtain better image quality. At this time, the first gamma algorithm can be a gamma algorithm with a gamma value γ < 1 in [-R1, -R2] and [R2, R1], and a gamma value γ > 1 in [-R2, R2]. Wherein, R2 < R1. The data compression device 200 can perform the second boundary P E2 Specifically, the data compression device 200 can adjust the second boundary P E2The boundary value corresponding to each pixel in is compared with the boundary thresholds R1 and R2; when the boundary value is within [-R1, -R2] or [R2, R1], the boundary value is enhanced using a gamma algorithm with a gamma value γ < 1 to increase the absolute value of the boundary value; when the boundary value is within [-R2, R2], the boundary value is weakened using a gamma algorithm with a gamma value γ > 1 to reduce the absolute value of the boundary value, thereby eliminating the second boundary P E2 When the boundary value is outside [-R1, R1], no adjustment is performed. The data compression device 200 can adjust the second boundary P by Table 2. E2 The boundary enhancement and the boundary weakening are performed. Taking R1=5 and R2=1 as an example, Table 2 can be expressed as:
[0141]
[0142] As shown in Table 2, when the boundary value is within [-1, 1], the gamma value γ>1 performs the boundary weakening to reduce noise. When the boundary value is within [-5, -1] and [1, 5], the gamma value γ<1 performs the boundary enhancement.
[0143] Figure 5C FIG. 2 shows another flow chart of performing boundary adjustment according to an embodiment of the present specification. Figure 5C As shown, step SA242-8 may also be: the data compression device 200 directly performs the first gamma algorithm on the first boundary P E1 The boundary value in is within the first preset range [-R3, R3], and the enhanced boundary P is obtained. E . R3 may be different from R1 or the same as R1.
[0144] Step SA242 may also include:
[0145] SA242-9: The first frame P L1 With the enhanced boundary P E The first enhanced frame P′0 is obtained by superimposing.
[0146] Step SA240 may also include:
[0147] SA244: Perform the coding spectrum adjustment and the coding on the first enhanced frame P′0.
[0148] In step SA244, the data compression device 200 can first perform the coding spectrum adjustment on the first enhanced frame P′0, so that the amplitude of the first enhanced frame P′0 in the frequency domain is steadily reduced, thereby blurring the boundary information of the first enhanced frame P′0, and obtaining a coding spectrum adjustment frame, so as to reduce the amount of information in the first enhanced frame P′0, thereby reducing the space resources occupied by the first enhanced frame P′0 after compression. Then, the coding spectrum adjustment frame is encoded, that is, predicted and residual is calculated, and the coding spectrum adjustment frame is predicted to obtain the predicted frame of the coding spectrum adjustment frame and the predicted data PI; then, the predicted frame of the coding spectrum adjustment frame is subtracted from the initial frame of the coding spectrum adjustment frame to obtain the residual data R of the coding spectrum adjustment frame, and the residual data R and the predicted data PI are input into the code stream generation module for synthesis to obtain the compressed frame. The data processing method P200 can improve the coding efficiency of the coding spectrum adjustment frame, further reduce the amount of data in the compressed frame, improve the coding efficiency, and improve the compression ratio. Since the object of the coding spectrum adjustment is the first enhanced frame P'0, the compressed frame is the first enhanced frame P'0. Taking video data as an example, step SA244 may include:
[0149] SA244-2: Determine the frame type of the initial frame.
[0150] As mentioned above, when encoding video data using the H.264 or H.265 standard, frames are often compressed into different frame types according to frame images. Therefore, before the data compression device 200 performs the coding spectrum adjustment on the compressed frame (the first enhanced frame P′0), it is necessary to first determine the frame type of the initial frame, and different coding convolution kernels are selected for different frame types.
[0151] For a video frame sequence, specific frame types may include intra-frame prediction frames (Intra Picture, referred to as I-frames), forward prediction frames (Predictive Frames, referred to as P-frames), and bi-directional prediction frames (Bi-directional Predictive Frames, referred to as B-frames). For a frame sequence with only one frame, it is usually processed according to the intra-frame prediction frame (I-frame). The I-frame is a coded frame compressed within the entire frame. During decoding, the complete data can be reconstructed using only the data of the I-frame without referring to other pictures, and can be used as a reference frame for several subsequent frames. The P-frame is a coded frame that compresses the amount of transmitted data by fully reducing the temporal redundant information with the previously coded frames in the image sequence. The P-frame is predicted by the P-frame or I-frame before it, and it compresses the current frame based on the difference between the current frame and the previous frame or frames. The method of jointly compressing the P-frame and the I-frame can achieve higher compression without obvious compression traces. It only refers to the previous I-frame or P-frame close to it. The B-frame compresses the current frame based on the difference between the previous frames, the current frame, and the next frames, that is, it only records the difference between the current frame and the previous and next frames. Generally, I frames have the lowest compression efficiency, P frames have a higher compression efficiency, and B frames have the highest compression efficiency. During the encoding process of video data, some video frames will be compressed into I frames, some will be compressed into P frames, and some will be compressed into B frames. The frame type of the initial frame includes at least one or more of I frames, P frames, and B frames.
[0152] SA244-4: Based on the frame type of the initial frame, select a convolution kernel from the coding convolution kernel group as the coding convolution kernel, perform convolution on the compressed frame, and obtain a coded spectrum adjustment frame.
[0153] Specifically, step SA244-4 may be to perform the coding spectrum adjustment on the compressed frame (first enhanced frame P′0) to obtain the coding spectrum adjustment frame. The coding spectrum adjustment includes convolving the compressed frame with a coding convolution kernel so as to smoothly reduce the amplitude of the compressed frame in the intermediate frequency region in the frequency domain.
[0154] The spectrum adjustment for the compressed frame can be expressed as multiplying the compressed frame by the transfer function H1(f) (i.e., the coding spectrum adjustment function) in the frequency domain or performing a corresponding convolution calculation in the time domain. If the compressed frame is digitized data, the convolution operation can be to select a coding convolution kernel corresponding to the coding spectrum adjustment function H1(f) for convolution operation. For the convenience of description, this specification will take convolution in the time domain as an example to describe the spectrum adjustment, but those skilled in the art should understand that the method of performing spectrum adjustment by multiplying the coding spectrum adjustment function H1(f) in the frequency domain is also within the scope of protection of this specification.
[0155] As mentioned above, the coding spectrum adjustment for the compressed frame can be expressed as convolution of the compressed frame in the time domain. The storage medium of the data compression device 200 can store multiple coding spectrum adjusters, that is, the coding spectrum adjuster group. Each coding spectrum adjuster includes a coding convolution kernel group. That is to say, the storage medium of the data compression device 200 may include the coding convolution kernel group, and the coding convolution kernel group may include at least one convolution kernel. When the data compression device 200 performs convolution on the compressed frame, it can select a convolution kernel from the coding convolution kernel group as the coding convolution kernel based on the frame type of the compressed frame corresponding to the initial frame, and perform convolution on the compressed frame. When the compressed frame corresponding to the initial frame is an I frame or a P frame, the data compression device 200 performs convolution on the I frame or the P frame, including selecting a convolution kernel from the coding convolution kernel group as the coding convolution kernel, and performing convolution on the I frame or the P frame. Any convolution kernel in the convolution kernel group can reduce the amplitude of the I frame or P frame in the frequency domain, and the amplitude in the intermediate frequency region can be reduced smoothly. The data compression device 200 can also select a convolution kernel with the best compression effect from the coding convolution kernel group as the coding convolution kernel according to the coding quality requirement for the initial frame. When the compressed frame corresponding to the initial frame (i.e., the first enhanced frame in this embodiment) is a B frame, the coding convolution kernel of the compressed frame is the same as the coding convolution kernel corresponding to the reference frame closest to the compressed frame, or the coding convolution kernel of the compressed frame is the same as the coding convolution kernel corresponding to the reference frame with the largest attenuation degree in the closest reference frame in two adjacent directions, or the coding convolution kernel of the compressed frame takes the average value of the coding convolution kernels corresponding to the closest reference frames in two adjacent directions. When the distance between the B frame and the two adjacent reference frames is the same, the coding convolution kernel of the compressed frame can take the coding convolution kernel corresponding to any reference frame in the two adjacent directions, for example, the current B frame selects the convolution kernel corresponding to the forward adjacent reference frame. This can make the amplitude reduction effect of the compressed frame better, the coding spectrum adjustment effect better, and make the compression ratio of the video data higher.
[0156] Fig. 8A FIG. 4 shows a curve diagram of a coding spectrum adjustment function H1(f) provided according to an embodiment of the present specification. Fig. 8A As shown, the horizontal axis is the normalized frequency f, and the vertical axis is the amplitude adjustment gain H1 of the coding spectrum adjustment function H1 (f). Fig. 8ACurves 1 and 2 in the figure represent different coding spectrum adjustment functions H1(f) corresponding to different coding convolution kernels. Taking video data as an example, since the human eye is more sensitive to low-frequency to medium-frequency data than to high-frequency data, when performing the coding spectrum adjustment on the video data, the low-frequency to medium-frequency information contained in the initial frame should be retained as much as possible without loss, and the amplitude gain of the medium-frequency and low-frequency regions should be kept relatively stable, so that the information in the low-frequency to medium-frequency region can be as relatively stable and complete as possible, so that the information in the low-frequency to medium-frequency region can be better restored during decompression. Therefore, the coding spectrum adjustment function H1(f) used in the coding spectrum adjustment can be greater than zero for the amplitude adjustment gain H1 at any frequency f in the low-frequency to medium-frequency region of the compressed frame in the frequency domain, and the amplitudes of all frequencies in the low-frequency to medium-frequency region after being processed by the coding spectrum adjustment function H1(f) are also greater than zero, and no data of any frequency will be lost in the low-frequency to medium-frequency region. Therefore, when the compressed data is decompressed, the data in all frequency ranges of the low-frequency to medium-frequency region can be restored. Otherwise, if there is a zero point in the low-frequency to medium-frequency region in the coding spectrum adjustment function H1(f), the data of the frequency part corresponding to the zero point may be lost, and the decoding end will not be able to recover the lost data during decompression, so the initial data cannot be recovered. As mentioned above, we define the data obtained after the first enhanced frame P′0 is processed by the coding spectrum adjustment function H1(f) as P1, so the data of the coding spectrum adjustment frame is defined as P1. Since P′0 only enhances P0 in a small range and does not enhance the area outside the first preset range, P′0 is consistent with P0 in the area outside the first preset range. Therefore, the relationship between P0 and P1 can be expressed as the following formula:
[0157] P1=H1(f)·P′0≈H1(f)·P0 Formula (3)
[0158] Since the human eye is relatively insensitive to high-frequency data, when the encoding spectrum is adjusted for the video data, the amplitude of the high-frequency part can be attenuated to a greater extent, thereby further reducing the amplitude of the high-frequency region. In this way, the data information contained in the first enhanced frame can be reduced, and the compression ratio and encoding efficiency can be improved.
[0159] Therefore, the coding spectrum adjustment function H1(f) used in the coding spectrum adjustment can smoothly reduce the amplitude of the compressed frame in the frequency domain. In some embodiments, the coding spectrum adjustment function H1(f) used in the coding spectrum adjustment can smoothly reduce the amplitude of the compressed frame in the high-frequency region of its frequency domain. The smooth reduction of the amplitude can be that the amplitude is attenuated by the first amplitude adjustment gain value in the high-frequency region, or the amplitude is attenuated within a certain error range near the first amplitude adjustment gain value. For example, the first amplitude adjustment gain can be any value between 0 and 1. For example, the first amplitude adjustment gain can be within the interval specified by any two of the values 0, 0.04, 0.08, 0.12, 0.16, 0.20, 0.24, 0.28, 0.32, 0.36, 0.40, 0.44, 0.48, 0.52, 0.56, 0.60, 0.64, 0.68, 0.72, 0.76, 0.80, 0.84, 0.88, 0.92, 0.96 and 1. The error range may be within the interval specified by any two of the values of 0, ±1%, ±2%, ±3%, ±4%, ±5%, ±6%, ±7%, ±8%, ±9%, ±10%, ±11%, ±12%, ±13%, ±14%, ±15%, ±16%, ±17%, ±18%, ±19%, ±20%, ±21%, ±22%, ±23%, ±24%, ±25%, ±26%, ±27%, ±28%, ±29%, ±30%, etc. Fig. 8A As shown, the first amplitude adjustment gain of the coding spectrum adjustment in the high frequency region (approximately in the range of 0.4 to 0.5) is about 0.2.
[0160] In some embodiments, the coding spectrum adjustment function H1(f) used in the coding spectrum adjustment can smoothly reduce the amplitude of the intermediate frequency region of the compressed frame in the frequency domain. The amplitude adjustment gain of the coding spectrum adjustment on the intermediate frequency region of the compressed frame is a second amplitude adjustment gain. In some embodiments, the value of the second amplitude adjustment gain can be greater than the first amplitude adjustment gain, such as Fig. 8A When the coding spectrum is adjusted to frequency attenuation (that is, when the coding spectrum adjuster is the frequency attenuator), the first amplitude adjustment gain and the second amplitude adjustment gain are both less than 1. That is, the amplitude reduction amplitude of the intermediate frequency region in the compressed frame caused by the coding spectrum adjustment can be lower than the amplitude reduction amplitude of the high frequency region.
[0161] In addition, the coding spectrum adjustment function H1(f) can also smoothly reduce the amplitude of the low-frequency region of the compressed frame in the frequency domain. Among them, the amplitude adjustment gain of the coding spectrum adjustment to the low-frequency region of the compressed frame is the third amplitude adjustment gain. When the coding spectrum is adjusted to frequency attenuation (that is, when the coding spectrum adjuster is the frequency attenuator), the third amplitude adjustment gain and the second amplitude adjustment gain are both less than 1. The value of the third amplitude adjustment gain can be greater than or equal to the second amplitude adjustment gain. That is to say, the amplitude reduction amplitude of the low-frequency region of the compressed frame by the coding spectrum adjustment can be lower than or equal to the amplitude reduction amplitude of the intermediate frequency region.
[0162] Furthermore, in order to save the amount of calculation required in the implementation process and avoid the occurrence of ringing effects, the coding spectrum adjustment function H1(f) should make the amplitude of the first enhanced frame P′0 in the frequency domain smoothly transition. As mentioned above, when a spectrum adjustment process is performed on an image, if the selected spectrum adjustment function has a region with drastic changes in value, a higher-order convolution kernel or convolution kernel combination is required in the implementation process. This means an increase in unnecessary computational effort. At the same time, a high-order convolution kernel is more likely to cause the output image to produce a stronger color oscillation at the grayscale or color drastic change, which is called a ringing effect. The ringing effect often appears at the image boundary. By making the coding spectrum adjustment function H1(f) smoothly transition the amplitude adjustment gain of the first enhanced frame P′0 in the frequency domain, the drastic change of the amplitude adjustment gain can be avoided. For example, when the high-frequency region is not connected to the medium-frequency region, the coding spectrum adjustment function H1(f) can adjust the amplitude of the medium-high frequency region of the compressed frame in the frequency domain, so that the amplitude adjustment gain changes smoothly and continuously in the medium-high frequency region. When the mid-frequency region is not connected to the low-frequency region, the coding spectrum adjustment function H1(f) can adjust the amplitude of the mid- and low-frequency regions of the compressed frame in the frequency domain so that the amplitude adjustment gain changes continuously in the mid- and low-frequency regions.
[0163] The coding spectrum adjustment function H1(f) can also keep the DC part, that is, the amplitude adjustment gain of the part with a frequency of 0, as 1, to ensure that the basic information in the first enhanced frame P′0 can be retained, and the average value information can be obtained when the data is decompressed to restore the original initial data. Therefore, the amplitude reduction amplitude of the low-frequency area of the coding spectrum adjustment function H1(f) used in the coding spectrum adjustment is lower than the amplitude reduction amplitude of the intermediate frequency area. However, when the amplitude gain of the DC part (that is, the part with a frequency of 0) is not 1, the initial data can also be restored by designing a suitable decoding spectrum adjustment function H2(f). The specific relationship between H1(f) and H2(f) will be introduced in detail in the following description.
[0164] like Fig. 8A In the curve diagram of the coding spectrum adjustment function H1(f) shown in the figure, the frequency between (0, 0.1] belongs to low frequency; the frequency between (0.1, 0.15] belongs to medium-low frequency; the frequency between (0.15, 0.33] belongs to medium frequency; the frequency between (0.33, 0.4] belongs to medium-high frequency; the frequency between (0.4, 0.5] belongs to high frequency. The third amplitude adjustment gain in the low frequency area is greater than the second amplitude adjustment gain in the medium frequency area; the second amplitude adjustment gain in the medium frequency area is greater than the first amplitude adjustment gain in the high frequency area. At the same time, the second amplitude adjustment gain in the medium frequency area is relatively stable, and curve 1 is around 0.5, Curve 2 is around 0.6; the first amplitude adjustment gain H1 in the high-frequency region is also relatively stable, with curve 1 slightly below 0.2 and curve 2 slightly above 0.2. The curve of the coding spectrum adjustment function H1(f) is a smoothly transitioned curve. In engineering implementation, the curve of the coding spectrum adjustment function H1(f) can be allowed to fluctuate within a small range on the basis of achieving amplitude reduction, and the fluctuation does not affect the compression effect. For data in other forms besides video data, the parameters of the coding spectrum adjustment function H1(f) can be set according to the receiver's sensitivity to the data. For data in different forms, the receiver has different sensitivity to frequency.
[0165] Figure 8B FIG. 4 shows a curve diagram of a coding spectrum adjustment function H1(f) provided according to an embodiment of the present specification. Figure 8B Curve 3 and curve 4 in the figure represent different coding spectrum adjustment functions H1(f) corresponding to different coding convolution kernels. As far as video data is concerned, in some special application scenarios, it is necessary to appropriately retain more high-frequency components, such as reconnaissance scenarios. Therefore, in some embodiments, the first amplitude adjustment gain in the coding spectrum adjustment function H1(f) curve can be greater than the second amplitude adjustment gain (curve 3), or equal to the second amplitude adjustment gain (curve 4).
[0166] As for video data, in some application scenarios where the image quality requirement is not high, the high-frequency components can be completely filtered out. Therefore, the coding spectrum adjustment function H1(f) used in the coding spectrum adjustment has an amplitude adjustment gain H1 greater than zero for any frequency in the low-frequency to medium-frequency region of the compressed frame in the frequency domain, while the amplitude adjustment gain H1 for the high-frequency region can be equal to 0 ( Fig. 8A and Figure 8B not shown).
[0167] It should be noted that Fig. 8A and Figure 8BThe curve shown is only used as an example for explanation of video data. Those skilled in the art should understand that the curve of the coding spectrum adjustment function H1(f) is not limited to Fig. 8A and Figure 8B In the form shown, all coding spectrum adjustment functions H1(f) and linear combinations of coding spectrum adjustment functions that can smoothly reduce the amplitude of the intermediate frequency region of the first enhanced frame in the frequency domain are Or a combination of coded spectrum adjustment functions Or the combination of linear combination and product combination belongs to the protection scope of this specification. Where i≥1, represents the linear combination of n functions, H 1i (f) represents the i-th function, k i Represents the weight corresponding to the i-th function. j≥1, represents the product combination of n functions, k j represents the weight corresponding to the jth function, H 1j (f) can be any function.
[0168] Table 3 shows a parameter table of a coding convolution kernel provided according to an embodiment of the present specification. Table 3 exemplarily lists the parameters of a coding convolution kernel, wherein each row in Table 3 represents a coding convolution kernel. For 8-bit video images, it is necessary to ensure that the grayscale value of the pixel point in the coding spectrum adjustment frame obtained after the coding convolution is within the range of 0 to 255. Therefore, in this embodiment, it is necessary to divide the convolution result by 256. The coding convolution kernel is obtained by Fourier transform based on the coding spectrum adjustment function H1(f). Table 3 is only an exemplary illustration. Those skilled in the art should know that the coding convolution kernel is not limited to the parameters shown in Table 3. All coding convolution kernels that can smoothly reduce the amplitude of the intermediate frequency region in the frequency domain of the compressed frame belong to the scope of protection of this specification.
[0169]
[0170] It should be noted that in order to avoid the ringing effect, the coding spectrum adjustment function H1(f) is a smoothly transitioned curve to avoid a sharp change in the amplitude adjustment gain in the curve. As mentioned above, the ringing effect refers to the situation in image processing where, when an image is subjected to spectrum adjustment processing, if the selected spectrum adjustment function has a fast change, the image will "ring". The so-called "ringing" refers to the oscillation generated at the place where the grayscale of the output image changes dramatically, just like the air oscillation generated when a bell is struck. The ringing effect often appears at the image boundary.
[0171] The ratio of the absolute value of the sum of negative coefficients in the coding convolution kernel corresponding to the coding spectrum adjustment function H1(f) to the sum of non-negative coefficients should be less than 0.1. For example, in some embodiments, the convolution kernel coefficients in the coding convolution kernel can all be non-negative numbers. Taking video data as an example, when there are more negative coefficients in the coding convolution kernel, the pixel values at the image boundary vary greatly. A large pixel value multiplied by a negative coefficient will make the final result of the convolution smaller, which is reflected in the image as darker pixels. If a negative number appears in the convolution result and the absolute value of the negative number is large, when the unsigned integer is used to calculate the convolution result, the unsigned integer calculation result may be reversed. The unsigned complement value of a negative number will cause the convolution result to become larger, which is reflected in the image as brighter pixels. Therefore, when designing the coding convolution kernel, the coefficients of the coding convolution kernel can all be non-negative numbers, or the ratio of the absolute value of the sum of the negative coefficients in the coding convolution kernel to the sum of the non-negative coefficients should be less than 0.1, that is, a small number of negative coefficients with small absolute values are allowed to appear in the coding convolution kernel.
[0172] When the data compression device 200 uses the encoded convolution kernel to convolve the compressed frame, it can convolve the compressed frame (initial frame) in at least one direction of the vertical direction, the horizontal direction and the diagonal direction.
[0173] It should be pointed out that when performing the convolution on compressed frames, the data processing unit processed can be a frame of data or a part of a frame of data. Taking video data as an example, the unit can be a frame or a field of image, or a part of a frame / field of image. For example, in video encoding, the image is further divided into strips (slices), tiles (tiles), coding units (coding units, CU), macroblocks (macroblocks), or blocks (blocks). The convolution object includes but is not limited to a part of the image segmentation unit described by the above terms. In different processing units, the same coding convolution kernel can be selected, or different coding convolution kernels can be selected.
[0174] Step SA244 may also include:
[0175] SA244-6: Perform the encoding (prediction and residual calculation) on the encoded spectrum adjustment frame to obtain the predicted data PI and the residual data R.
[0176] SA244-8: Input the prediction data PI and the residual data R into the bit stream generation module for synthesis to obtain the compressed frame.
[0177] After the data compression device 200 performs the coding spectrum adjustment on the first enhanced frame, the coding spectrum adjustment frame is obtained, and the frequency component from low frequency to high frequency in the coding spectrum adjustment frame is smaller than the frequency component from low frequency to high frequency in the first enhanced frame. Therefore, the data compression device 200 can improve the coding efficiency of the coding spectrum adjustment frame by performing coding and code stream generation calculation after performing the coding spectrum adjustment on the compressed frame (first enhanced frame), thereby improving the compression ratio of the initial frame and the transmission efficiency of the initial data; at the same time, the boundary enhancement can avoid detail loss.
[0178] Figure 4B The data processing method shown in PB200 is Figure 3B The flowchart shown in FIG. Figure 4B The method PB200 shown may include:
[0179] SB220: Selecting an initial frame in the initial data. This is the same as step SA220 and will not be described in detail here.
[0180] SB240: compressing the data of the initial frame to obtain a compressed frame. Step SB240 may include:
[0181] SB242: Perform the boundary adjustment on the initial frame P0 to obtain a first enhanced frame P′0. This is the same as step SA242 and will not be described in detail here.
[0182] SB244: performing the coding spectrum adjustment and the coding on the first enhanced frame P′0. Step SB244 may include:
[0183] SB244-2: Determine the frame type of the initial frame. This is the same as step SA244-2 and will not be described in detail here.
[0184] SB244-4: Predict the first enhanced frame P′0 to obtain a predicted frame and predicted data PI.
[0185] SB244-6: Based on the frame type of the initial frame, select a convolution kernel from the coding convolution kernel group as the coding convolution kernel, perform convolution on the compressed frame, and obtain a coding spectrum adjustment frame. The compressed frame includes the first enhanced frame P′0 and the predicted frame. Step SB244-6 can be equivalent to using the coding spectrum adjustment function H1(f) to perform the coding spectrum adjustment on the first enhanced frame P′0 and the predicted frame. The coding spectrum adjustment frame includes a first coding spectrum adjustment frame after the coding spectrum adjustment is performed on the first enhanced frame P′0 and a second coding spectrum adjustment frame after the coding spectrum adjustment is performed on the predicted frame.
[0186] SB244-8: Calculate the residual of the first coded spectrum adjustment frame and the second coded spectrum adjustment frame to obtain the residual data R.
[0187] SB244-9: Input the prediction data PI and the residual data R into the bit stream generation module for synthesis to obtain the compressed frame.
[0188] Figure 4C The data processing method shown in PC200 is Figure 3C The flowchart shown in FIG. Figure 4C The method PC200 shown may include:
[0189] SC220: Select an initial frame in the initial data. This is the same as step SA220 and will not be described in detail here.
[0190] SC240: Perform the data compression on the initial frame to obtain a compressed frame. Step SC240 may include:
[0191] SC242: perform the boundary adjustment on the initial frame P0 to obtain a first enhanced frame P′0. This is the same as step SA242 and will not be described in detail herein.
[0192] SC244: performing the coding spectrum adjustment and the coding on the first enhanced frame P′0. Step SC244 may include:
[0193] SC244-2: Determine the frame type of the initial frame. This is the same as step SA244-2 and will not be described in detail here.
[0194] SC244-4: The first enhanced frame P′0 is first encoded, that is, predicted and residual is calculated to obtain prediction data PI and residual data R1.
[0195] SC244-6: Based on the frame type of the initial frame, select a convolution kernel from the coding convolution kernel group as the coding convolution kernel, and convolve the compressed frame to obtain the residual data R. The compressed frame includes the residual data R1. Step SC244-6 can be equivalent to using the coding spectrum adjustment function H1(f) to adjust the coding spectrum of the residual data R1.
[0196] SC244-8: Input the prediction data PI and the residual data R into the bitstream generation module for synthesis to obtain the compressed frame.
[0197] Figure 4D The data processing method PD200 is shown with Figure 3D The flowchart shown in FIG. Figure 4D The method PD200 shown may include:
[0198] SD220: Select an initial frame in the initial data. This is the same as step SA220 and will not be described in detail here.
[0199] SD240: perform the data compression on the initial frame to obtain a compressed frame. Wherein, step SD240 may be to first perform the coding spectrum adjustment on the initial frame, and then perform the boundary adjustment. Specifically, step SD240 may include:
[0200] SD242: Perform the coding spectrum adjustment on the initial frame to obtain a coding spectrum adjustment frame.
[0201] For the convenience of description, the data in the coded spectrum adjustment frame obtained in step SD242 is defined as P 01 Specifically, step SD242 may include:
[0202] SD242-2: Determine the frame type of the initial frame. This is the same as step SA244-2 and will not be described in detail here.
[0203] SD242-4: Based on the frame type of the initial frame, select a convolution kernel from the coding convolution kernel group as the coding convolution kernel, perform convolution on the compressed frame, and obtain the coded spectrum adjustment frame P 01 The compressed frame includes the initial frame P0. Step SD242-4 may be equivalent to using the coding spectrum adjustment function H1(f) to adjust the coding spectrum of the initial frame P0.
[0204] SD244: Adjust the frame P of the coded spectrum 01 The boundary adjustment is performed to obtain a second enhanced frame.
[0205] For the convenience of description, we define the data in the second enhanced frame obtained in step SD244 as P′1. Fig. 9 FIG. 4 shows a flow chart of obtaining a second enhanced frame P′1 according to an embodiment of the present specification. Fig. 9 and Figure 4D As shown, step SD244 may include:
[0206] SD244-2: Adjust the initial frame P0 and the coded spectrum frame P 01 Take the difference and get the first boundary P E1 .
[0207] As mentioned above, the coding spectrum adjustment can make the amplitude of the initial frame P0 in the frequency domain steadily decrease, thereby blurring the boundary information of the initial frame P0, and obtaining the coding spectrum adjustment frame P 01, in order to reduce the amount of information in the initial frame P0, thereby reducing the space resources occupied by the initial frame P0 after compression. 01 It can be understood as data that attenuates the boundary information in the initial frame P0. Next, the initial frame P0 and the coded spectrum adjustment frame P 01 By taking the difference, we can get the boundary attenuation value of the initial frame P0, that is, the first boundary P E1 The first boundary P E1 Includes boundary information of the initial frame P0.
[0208] In some embodiments, step SD244 may further include:
[0209] SD244-4: The first boundary P is adjusted by the first coefficient a E1 This step is basically the same as step SA242-6, and will not be described in detail here.
[0210] SD244-6: Using the first gamma algorithm, the first boundary P E1 The middle boundary value is within the first preset range [-R1, R1] to adjust the boundary to obtain the enhanced boundary P E This step is basically the same as step SA242-8 and will not be described again here.
[0211] SD244-8: The enhanced boundary P E With the first boundary P E1 Find the difference and get the adjustment value.
[0212] For the convenience of description, we define the data in the adjustment value as E d . Adjustment value E d The first boundary P E1 The adjustment value when making adjustments.
[0213] In some embodiments, step SD244-6 and step SD244-8 may be combined. Table 4 may be stored in the data compression device 200. Table 4 stores the first boundary P E1 The input boundary value and adjustment value E d For example, R1 = 6, Table 4 can be expressed as:
[0214]
[0215] The data compression device 200 can directly obtain the adjustment value E according to Table 4 d .
[0216] SD244-9: Adjust the coded spectrum frame P 01 With the adjustment value Ed The two frames are superimposed to obtain the second enhanced frame P′1.
[0217] As mentioned above, the coding spectrum adjustment can make the coding spectrum adjustment frame P 01 The coded spectrum adjustment frame P 01 In order to avoid loss of details, the coded spectrum is adjusted to frame P 01 and the adjustment value E d Superposition is performed to adjust the coded spectrum frame P 01 The boundaries between adjacent pixels with small differences are enhanced, thereby reducing data loss during the encoding process and avoiding detail loss.
[0218] Step SD240 may further include:
[0219] SD246: Predict the second enhanced frame P′1 and calculate the residual.
[0220] The second enhanced frame P′1 is encoded (predicted and residual calculated) to obtain the predicted data PI and the residual data R, and the predicted data PI and the residual data R are input into the bit stream generation module for synthesis to obtain the compressed frame.
[0221] In summary, the data processing method P200 can simultaneously perform the boundary adjustment and the coding spectrum adjustment on the initial frame, thereby improving the compression ratio of the initial frame, improving the coding efficiency and the transmission efficiency of the initial data, while reducing data loss and avoiding loss of details.
[0222] Fig.10 A flow chart of a method P300 for data processing of decompressing a compressed frame is shown. As mentioned above, the data decompression device 300 can execute the data processing method P300. Specifically, the storage medium in the data decompression device 300 can store at least one set of instruction sets. The instruction set is configured to instruct the decompression processor in the data decompression device 300 to complete the data processing method P300. When the data decompression device 300 is running, the decompression end processor can read the instruction set and execute the data processing method P300.
[0223] For the convenience of description, we will use Figure 3A and Figure 3D The method shown in describes the data processing method P300. The method P300 may include:
[0224] S320: Obtain compressed data, wherein the compressed data includes the compressed frame.
[0225] The compressed data may include the compressed frame obtained by compressing the initial frame in the initial data by the data processing method P200. The compressed frame includes the compressed prediction data PI and residual data R. Figure 3A and Figure 3D As shown, step S320 may include: inputting the compressed frame into the code stream parsing module for analysis and calculation to obtain the predicted data PI and the residual data R. As mentioned above, in the present application, a frame is a common processing unit for constituting a data sequence. When processing data, calculations are often performed in frames. In the data processing method P200 in which the data compression device 200 compresses data, the initial data may be compressed in frames. When the data decompression device 300 decompresses the compressed frame, the data may also be decompressed in frames.
[0226] S340: Decompress the compressed frame to obtain a decompressed frame.
[0227] The data decompression refers to performing a decompression calculation on the compressed frame to obtain a decompressed frame, so that the decompressed frame is restored or substantially restored to the initial data, or the decompressed frame is clearer than the initial data. Taking video data as an example, when the amplitude of the decompressed frame at any frequency in the low-frequency to medium-frequency region is restored to the threshold value or above the threshold value of the initial frame, it is difficult for the human eye to perceive the difference between the decompressed frame and the initial frame. The threshold value can be any value between 80% and 90%. For example, the threshold value can be any value in a closed interval defined by any two values of 80%, 81%, 82%, 83%, 84%, 85%, 86%, 87%, 88%, 89%, and 90%. For example, the data decompression should make the amplitude of the decompressed frame at any frequency in the low-frequency to medium-frequency region not less than 85%±3% of the initial frame.
[0228] The data decompression includes adjusting the decoding spectrum of the frame being decompressed, and further correcting the boundary of the data after the decoding spectrum adjustment, so as to obtain the required decompressed frame. The frame being decompressed is a frame of data being decompressed, including the compressed frame and any data state before the compressed frame becomes the decompressed frame during the decompression process.
[0229] Taking video data as an example, the data processing method P200 uses a method combining coding spectrum adjustment and coding to compress the initial frame, so as to further improve the compression ratio of video data and improve the efficiency of video transmission. In video decompression technology, the data processing method P300 can use a method combining decoding (i.e., restoring the compressed frame according to the residual data R and the predicted data PI) and decoding spectrum adjustment to decompress the compressed frame to obtain the required decompressed frame to restore the data in the compressed frame. The decompressed frame may include the compressed frame and any data state of the compressed frame in the decoding process according to the predicted data PI and the residual data R. For example, the decompressed frame may be the compressed frame, or it may be a decoded frame obtained through decoding, or a predicted frame obtained through prediction, and so on.
[0230] The decoding spectrum adjustment applied to the data decompression of the compressed frame refers to the decoding spectrum adjustment in the frame decompression input decoding spectrum adjuster. The decoding spectrum adjustment can correspond to the coding spectrum adjustment, that is, there should be a pre-set association relationship between the decoding spectrum adjustment function H2(f) and the coding spectrum adjustment function H1(f). By carefully setting the association relationship between the decoding spectrum adjustment function H2(f) and the coding spectrum adjustment function H1(f), the compressed frame of the coding spectrum adjustment is completely restored or basically restored to the data index before the coding spectrum adjustment (such as the image clarity of the image data) without considering other calculation errors after the decoding spectrum adjustment and the data processing, and even exceeds the data before the coding adjustment in some indicators (such as the clarity of the decoded image exceeds the original image). The specific association relationship between the decoding spectrum adjustment function H2(f) and the coding spectrum adjustment function H1(f) is related to the data processing method of the data after the decoding spectrum adjustment. The association relationship between the spectrum adjustment function H2(f) and the coding spectrum adjustment function H1(f) is different depending on the data processing method. The specific method of data processing and the correlation between the spectrum adjustment function H2(f) and the coding spectrum adjustment function H1(f) will be introduced in detail in the following description.
[0231] Like the coding spectrum adjustment, the decoding spectrum adjustment can also be performed by convolution in the time domain, thereby adjusting the spectrum in the deframe in the frequency domain with the decoding spectrum adjustment function H2(f) (i.e., the decoding transfer function). Therefore, the decoding convolution kernel used in the decoding spectrum adjustment should also have a corresponding association with the encoding convolution kernel used in the coding spectrum adjustment. By selecting the decoding spectrum adjustment function H2(f) and the decoding convolution kernel corresponding to the coding spectrum adjustment function H1(f) and the coding convolution kernel, the two methods can achieve the same effect. For the convenience of description, this specification will take convolution in the time domain as an example to describe the decoding spectrum adjustment, but those skilled in the art should understand that the method of performing spectrum adjustment by multiplying the decoding spectrum adjustment function H2(f) in the frequency domain is also within the scope of protection of this specification.
[0232] As mentioned above, the coding spectrum adjustment can attenuate the amplitude of the intermediate frequency region of the compressed frame in its frequency domain, blur the boundary data of the compressed frame, and thus reduce the amount of data generated by encoding. The decoding spectrum adjustment and the data processing can restore or even enhance the data after the coding spectrum adjustment and data processing. That is, the decoding spectrum adjustment and the data processing can completely restore or basically restore the amplitude of the sensitive frequency in the de-frame to the state before attenuation or even enhance it relative to the state before attenuation. Taking video data as an example, since the human eye is more sensitive to low-frequency to intermediate frequency information in the image, the decoding spectrum adjustment and the data processing can restore or even enhance the amplitude of the low-frequency to intermediate frequency region in the video data. Therefore, the amplitude of the decompressed frame in the low-frequency to intermediate frequency region should at least be restored or basically restored to the amplitude of the initial frame in the low-frequency to intermediate frequency region. In video data, since the human eye is less sensitive to high-frequency data, the decoding spectrum adjustment and the data processing may not restore the amplitude of the high-frequency region, so that the amplitude of the high-frequency region remains attenuated.
[0233] As mentioned above, the data compression operation adjusts the encoding spectrum to attenuate the amplitude of the initial frame in the intermediate frequency region or the intermediate frequency to high frequency region, thereby reducing the amount of data information in the initial frame. Taking video data as an example, since the edge of the object in the image is rich in intermediate frequency and high frequency information, and the intermediate frequency and high frequency regions carry more data, reducing the amplitude of the intermediate frequency to high frequency region will visually blur the boundary data of the compressed frame, and will also greatly reduce the amount of information in the image. Therefore, the data decompression can extract the boundary information from the compressed frame, and enhance the boundary information to restore it to the state in the initial frame, or enhance it relative to the state in the initial frame.
[0234] There are many ways to process the boundary enhancement. Traditional technology sometimes directly uses a high-pass filter or a band-pass filter to filter the compressed frame, filters out the components of the low-frequency area in the compressed frame, and extracts the components of the medium-frequency to high-frequency area in the compressed frame, thereby extracting the boundary information. However, there will be more negative coefficients in the coefficients of the convolution kernel corresponding to the high-pass filter and the band-pass filter. As mentioned above, when there are more negative coefficients in the convolution kernel, a strong ringing effect may appear in the image obtained by convolution of the convolution kernel. Therefore, in order to avoid the ringing effect, the data decompression described in this specification uses a smoothly transitioned decoding spectrum adjustment function H2 (f) to adjust the spectrum of the compressed frame, filter the components of the medium-frequency to high-frequency area in the compressed frame, and then find the difference between the compressed frame and the compressed frame adjusted by the decoding spectrum, so as to obtain the boundary information, and adjust the boundary information using the adjustment coefficient to restore it to the initial state or enhance it relative to the initial state. When using the above scheme to obtain boundary information, a decoding convolution kernel can be designed so that all its coefficients are non-negative numbers, or the ratio of the absolute value of the sum of negative coefficients to the sum of non-negative coefficients is less than 0.1, which can avoid the occurrence of ringing effect.
[0235] Specifically, step S340 may include:
[0236] S342: Decode the compressed frame to obtain a decoded frame. In the method P300, the decoded frame may be the decoded frame.
[0237] The compressed frame can be obtained by encoding the spectrum adjustment frame by the data compression device 200. The data decompression device 300 can decode the compressed frame to obtain the decoded frame. That is, the predicted frame is predicted according to the predicted data PI, and superimposed with the residual data R to obtain the decoded data P2, and the decoded data P2 is the data P2 of the decoded frame. There may be certain errors in the encoding and decoding process. Assuming that the deviation caused by the encoding and decoding process is very small, the data P2 in the decoded frame is basically consistent with the data P1 in the encoded spectrum adjustment frame. Therefore, the relationship between P1 and P2 can be expressed as the following formula:
[0238] P2≈P1 formula (4)
[0239] The data decompression device 300 may perform the decoding spectrum adjustment and the boundary correction on the decoded frame. Fig.11A A flowchart of the decoding spectrum adjustment and the boundary correction provided according to an embodiment of this specification is shown. Fig.11A and Fig.10 Corresponding. Fig.11A and Fig.10 As shown, step S340 may also include:
[0240] S344: performing the decoding spectrum adjustment on the decoded frame (ie, the decoded frame P2) to obtain a decoded spectrum adjusted frame.
[0241] For the convenience of description, we define the data in the decoded spectrum adjustment frame as P C . The decoding spectrum adjustment prevents the decoding frame from having a ringing effect. The decoding spectrum adjustment includes using the decoding spectrum adjustment function H2(f) to perform the decoding spectrum adjustment on the decoded frame, so that the amplitude of the decoded frame in the frequency domain is smoothly reduced to filter the components in the intermediate frequency to high frequency region of the decoded frame to obtain the decoding spectrum adjusted frame. The intermediate frequency to high frequency components in the spectrum of each frame of data are mainly concentrated in the area where the data in this frame of data changes dramatically, that is, the boundary data of the data. For example, for a frame of image, the intermediate frequency to high frequency data are mainly concentrated at the boundaries of objects in the image, that is, the boundary data of this frame of image. Therefore, the data P in the decoding spectrum adjustment frame C It can be understood that the data of the boundary information in the decoded frame P2 is removed. C It can be expressed as the following formula:
[0242] P C =H2(f)·P2=H1(f)·H2(f)·P′0≈H1(f)·H2(f)·P0 Formula (5)
[0243] The decoding spectrum adjustment includes convolving the de-frame (decoded frame) with the corresponding decoding convolution kernel based on the encoding convolution kernel. In order to avoid the ringing effect, the ratio of the absolute value of the sum of the negative coefficients in the decoding convolution kernel to the sum of the non-negative coefficients is less than a threshold. For example, the threshold can be any one of 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.2, 0.3, 0.4 or any value in the interval defined by any two numbers. For example, the convolution kernel coefficients in the decoding convolution kernel can all be selected as non-negative numbers. The amplitude adjustment gain for the intermediate frequency to high frequency region in the decoding spectrum adjustment function H2 (f) is equal to 0, and can fluctuate within a certain error range. The error range can be within the interval specified by any two of the following values: 0, ±1%, ±2%, ±3%, ±4%, ±5%, ±6%, ±7%, ±8%, ±9%, ±10%, ±11%, ±12%, ±13%, ±14%, ±15%, ±16%, ±17%, ±18%, ±19%, ±20%, ±21%, ±22%, ±23%, ±24%, ±25%, ±26%, ±27%, ±28%, ±29%, ±30%, ±31%, ±32%, ±33%, ±34%, ±35%, etc.
[0244] The decoded spectrum adjustment function H2(f) can keep the DC part, that is, the amplitude adjustment gain of the part with a frequency of 0, at 1, so as to ensure that the basic information in the initial frame can be retained. Therefore, the decoded spectrum adjustment function H2(f) used in the decoded spectrum adjustment smoothly transitions the amplitude adjustment gain of the low-frequency region from the amplitude adjustment gain of 1 at the position with a frequency of 0 to the amplitude adjustment gain of the intermediate frequency region close to 0.
[0245] Step S344 may include: determining the frame type of the decoded frame; based on the frame type of the decoded frame, selecting a convolution kernel from a decoding convolution kernel group as the decoding convolution kernel, and performing convolution on the decoded frame.
[0246] As mentioned above, the data compression device 200 will encode the initial frame or the coded spectrum adjustment frame into different types during the process of compressing the initial frame. Therefore, before the data decompression device 300 performs the decoding spectrum adjustment on the decoded frame, it is necessary to first determine the frame type of the decoded frame, and the decoding convolution kernel selected for different frame types is also different. The frame type of the decoded frame may include at least one of an I frame, a P frame, and a B frame. The frame type of the decoded frame may include only one frame type, or may include multiple frame types at the same time. The method for determining the frame type of the decoded frame is relatively mature and is not the focus of this specification, so it will not be repeated here.
[0247] As mentioned above, the decoding spectrum adjustment of the decoded frame can be expressed as convolving the decoded frame in the time domain. The storage medium of the data decompression device 300 can store a plurality of different decoding convolution kernels, referred to as a decoding convolution kernel group. Each encoding convolution kernel has at least one corresponding decoding convolution kernel in the decoding convolution kernel group. When the data decompression device 300 performs convolution on the decoded frame, it can select a convolution kernel from the decoding convolution kernel group as the decoding convolution kernel based on the frame type of the decoded frame, and perform convolution on the decoded frame. The operation of using the decoding convolution kernel to perform convolution on the decoded frame can be referred to as a decoding spectrum adjuster. When the decoded frame is an I frame or a P frame, the data decompression device 300 performs convolution on the I frame or the P frame, including selecting a convolution kernel from the decoding convolution kernel group as the decoding convolution kernel, and performing convolution on the I frame or the P frame. The data decompression device 300 may also select a convolution kernel with the best decompression effect from the decoding convolution kernel group as the decoding convolution kernel according to the decoding quality requirement of the decoded frame. When the decoded frame is a B frame, the decoding convolution kernel of the decoded frame is the same as the decoding convolution kernel of the reference frame closest to the decoded frame, or the decoding convolution kernel of the decoded frame is the same as the decoding convolution kernel corresponding to the reference frame with the largest attenuation in the closest reference frames in two adjacent directions, or the decoding convolution kernel of the decoded frame takes the average value of the decoding convolution kernels corresponding to the closest reference frames in two adjacent directions. When the decoded frame is at the same distance from the two closest reference frames before and after, the decoding convolution kernel of the decoded frame takes the decoding convolution kernel of the closest reference frame in the forward or backward direction. When the decoded frame is a B frame, the reference frame corresponding to the decoding convolution kernel selected by the decoded frame should be the same as the reference frame corresponding to the coding convolution kernel selected by the compressed frame when performing the coding spectrum adjustment.
[0248] When the data decompression device 300 uses the decoding convolution core to perform convolution on the decompressed frame, it can perform convolution on the decompressed frame in at least one of the vertical direction, the horizontal direction and the oblique direction. The convolution direction of the decompressed frame is the same as that of the compressed frame, and the convolution order of the decompressed frame is opposite to that of the compressed frame. If the compressed frame only undergoes convolution in the vertical direction, the decompressed frame also only performs convolution in the vertical direction. Similarly, if the compressed frame only undergoes convolution in the horizontal direction or the oblique direction, the decompressed frame also only performs convolution in the horizontal direction or the oblique direction. If the compressed frame undergoes convolution in multiple directions, the decompressed frame also performs convolution in multiple directions, and the direction and order of the decompressed frame during convolution are opposite to those of the compressed frame during convolution. That is, the compressed frame first performs convolution in the vertical direction and then performs convolution in the horizontal direction, and the decompressed frame first performs convolution in the horizontal direction and then performs convolution in the vertical direction.
[0249] Step S340 may further include:
[0250] S346: Calculate the decoded frame (ie, the decoded frame P2) and the decoded spectrum adjustment frame P C Take the difference and get the third boundary.
[0251] For the convenience of description, we define the data in the third boundary as P E3 The third boundary P E3 is the boundary of the decoded frame, including the boundary information of the initial frame P0.
[0252] In some embodiments, step S340 may further include:
[0253] S347: The third boundary P is adjusted by the second coefficient b. E3 Make enhancements.
[0254] Wherein, the second coefficient b is any number greater than 1. In some embodiments, the third boundary P E3 The decoded frame P2 and the decoded spectrum adjustment frame P C In some other embodiments, the third boundary P E3 It can be the boundary enhanced by the second coefficient b. At this time, the third boundary P E3 It can also be expressed as the following formula:
[0255] P E3 =P2-P C =P2-P2*H2(f) Formula (6)
[0256] P E3 =b*(P2-P C )=b*(P2-P2*H2(f)) Formula (7)
[0257] As mentioned above, the components in the intermediate frequency to high frequency region in the decoded spectrum adjustment frame are filtered, and the components in the intermediate frequency to high frequency region in the decoded frame are obtained by subtracting the decoded frame from the decoded spectrum adjustment frame, that is, the boundary of the de-frame. The boundary of the de-frame includes the boundary information of the initial frame. As mentioned above, the data in the boundary of the de-frame is defined as the third boundary P E3 Wherein, b is an enhancement coefficient, which indicates the degree of enhancement of the boundary information. The larger b is, the stronger the degree of enhancement of the boundary information is. The adjustment coefficient b can be determined based on empirical values or obtained through machine learning training.
[0258] Step S340 may further include:
[0259] S348: Using a second gamma algorithm, the third boundary PE3 The boundary value of the middle boundary is within the second preset range, so as to weaken the third boundary P E3 Perform noise reduction and obtain the noise reduction boundary.
[0260] For the convenience of description, we define the data in the noise reduction boundary as P E0 . The boundary correction includes weakening the boundary of the boundary value in the deframe boundary within a second preset range through a second gamma algorithm to perform noise reduction. In general, the image noise generated when encoding and decoding a video or image is usually within a small range. Therefore, when decompressing the data, the image noise within this small range generated by encoding and decoding can be subjected to noise reduction processing. When performing noise reduction processing, a gamma value γ greater than 1 can be used to weaken the boundary of the boundary value within the second preset range [-R4, R4] to achieve a noise reduction effect. The second preset range [-R4, R4] can be the boundary value that needs to be subjected to the boundary correction. The boundary value can be a third boundary P E3 The value corresponding to each pixel in R4 may be a boundary threshold. For example, R4 may be 30, 40, 50, etc. In some embodiments, R4 may be any number between 5 and 30.
[0261] Fig. 11B FIG. 4 shows a flow chart of performing the boundary correction according to an embodiment of the present specification. Fig. 11B As shown, step S348 may be: the data decompression device 300 uses the third adjustment function H L3 (f) For the third boundary P E3 Adjust to get the fourth boundary P E4 ; Through the second gamma algorithm, the fourth boundary P E4 The boundary value in is within the second preset range [-R4, R4], and the noise reduction boundary P is obtained. E0 .
[0262] The third boundary P E3 The boundary that does not need the boundary correction contains more components in the medium-frequency to high-frequency region. Therefore, in order to avoid the boundary correction from affecting other boundaries that do not need correction, the data decompression device 300 can first correct the third boundary P E3 Filtering is performed to filter the components in the mid-frequency to high-frequency region. The third adjustment function H L3 (f) may be a low-pass filter with a DC component equal to 1, so that the third boundary P E3 The components in the low-frequency region in the frequency domain are retained while the components in the medium-frequency to high-frequency region are filtered. L3(f) can be combined with the second adjustment function H L2 (f) Same.
[0263] The second gamma algorithm may be a gamma algorithm with a gamma value γ>1. In step S348, the data decompression device 300 may E4 Specifically, the data decompression device 300 can correct the fourth boundary P E4 The boundary value corresponding to each pixel in is compared with the boundary threshold R4; when the boundary value is within [-R4, R4], the second gamma algorithm is used to correct the boundary value to reduce the absolute value of the boundary value to perform boundary noise reduction; when the boundary value is outside [-R4, R4], no correction is performed.
[0264] The data decompression device 300 may use a table lookup method to perform the boundary correction. The data decompression device 300 may store Table 5. Table 5 stores the correspondence between the input boundary value and the output boundary value in the second gamma algorithm, that is, the correspondence between the boundary value before correction and the boundary value after correction. Taking R4=5 as an example, Table 5 can be expressed as:
[0265]
[0266] Fig. 11C FIG. 2 shows another flow chart of performing boundary correction according to an embodiment of the present specification. Fig. 11C As shown, step S348 may also be: the data decompression device 300 directly performs the third boundary P by using the second gamma algorithm. E3 The boundary value in is within the second preset range [-R5, R5], and the noise reduction boundary P is obtained. E0 . R5 may be different from R4 or the same as R4.
[0267] In some embodiments, the data decompression device 300 may further use the deviation value ΔE to compare the third boundary P E3 The boundary value in is within the second preset range [-R5, R5], and the noise reduction boundary P is obtained. E0 Among them, the noise reduction boundary P E0 The third boundary P E3 The data decompression device 300 may store Table 6. Table 6 stores the third boundary P E3 The corresponding relationship between the input boundary value and the deviation value ΔE and the input boundary value and the output boundary value. Taking R1 = 5 as an example, Table 6 can be expressed as:
[0268]
[0269] The data decompression device 300 can directly obtain the noise reduction boundary 0 according to Table 6 E0 .
[0270] S349: The noise reduction boundary P E0 The decompressed frame P4 is obtained by superimposing the decompressed frame P2 with the decompressed frame P2.
[0271] Since the boundary correction is only performed on the boundary within a small range, the boundary and non-boundary area outside the second preset range are not corrected. Therefore, the decompressed frame P4 can be expressed as the following formula:
[0272] P4=P2+P E0
[0273] =P2+P E3 +ΔE
[0274] ≈P′0·H1(f)·(1+b(1-H2(f)))
[0275] ≈P0·H1(f)·(1+b(1-H2(f))) Formula (8)
[0276] Taking video data as an example, since the human eye is more sensitive to information in the low-frequency to medium-frequency area, and the design of H1(f) only attenuates the amplitude of the low-frequency to medium-frequency area in the initial frame, the frequency information of all frequencies from low-frequency to medium-frequency in the initial frame is retained in the coded spectrum adjustment frame; the data P2 in the decoded frame is basically consistent with the data P1 in the coded spectrum adjustment frame, so the frequency information of the low-frequency to medium-frequency area is also retained in the decoded frame; and the components of the medium-frequency to high-frequency area in the decoded spectrum adjustment frame are filtered, so the frequency information of the low-frequency area is retained; therefore, the frequency information of the medium-frequency area in the initial frame is retained in the boundary of the de-frame obtained by the difference between the decoded frame and the decoded spectrum adjustment frame; and the noise reduction boundary only eliminates the noise in a small range in the boundary of the de-frame, and the boundary outside the second preset range is not processed; therefore, theoretically, without considering the deviation caused by other algorithms, the decompressed frame obtained by superimposing the decoded frame and the noise reduction boundary can completely restore or basically restore all frequency information from low-frequency to medium-frequency in the initial frame. That is to say, the data decompression can restore or even enhance the data compressed by the data at any frequency from low frequency to medium frequency. Therefore, after data decompression, the amplitude of the decompressed frame at any frequency in the low frequency to medium frequency region should be approximately equal to or greater than the initial frame. The approximately equal means that the amplitude of the decompressed frame is equal to the amplitude of the initial frame and fluctuates within a certain error range. Taking video data as an example, when the amplitude of the decompressed frame at any frequency in the low frequency to medium frequency region is restored to 85% or more of the initial frame, it is difficult for the human eye to perceive the difference between the decompressed frame and the initial frame. Therefore, after data decompression, the amplitude of the decompressed frame at any frequency in the low frequency to medium frequency region should not be less than 85% of the initial frame. That is, the error range should not make the amplitude of the decompressed frame at any frequency in the low frequency to medium frequency region lower than 85% of the initial frame. The human eye is relatively insensitive to information in the high frequency region. Therefore, the information in the high frequency region in the decompressed frame can be retained to adapt to the scene with high quality requirements, or it can be attenuated to suppress unnecessary high frequency noise. The relationship between P0 and P4 can be expressed as the following formula:
[0277] or
[0278]
[0279] It should be noted that a certain range of errors can be allowed in the formula. For example, P4≥P0 can be the case where the basic value of P4 is greater than or equal to P0, and P4 is allowed to fluctuate within a certain error range. That is to say, when P4=P0, P4 can be allowed to be slightly smaller than P0 in the case of a negative error. The formula here only lists the basic relationship formula between P4 and P0, and the error is not written into the formula. Those skilled in the art should understand that the fluctuation within the error range makes the amplitude of the decompressed frame in the low-frequency to medium-frequency region slightly smaller than the initial frame, which also falls within the scope of protection of this specification. In the following formulas, a certain range of errors is also allowed. The following only provides an explanation of the basic relationship that the amplitude of P4 is greater than or equal to the initial frame P0. For fluctuations within the error range, those skilled in the art can deduce it by themselves.
[0280] For the convenience of description, we define the overall spectrum adjustment function between P0 and P4 as H0(f), then the relationship between P0 and P4 can be expressed as the following formula:
[0281] P4=H0(f)·P0 Formula (11)
[0282] Then, the overall spectrum adjustment function H0(f) can be expressed as the following formula:
[0283] or
[0284]
[0285] Among them, f0 is the cutoff value of the human eye's sensitive frequency. For video data, f0 can be 0.33, or other values greater or less than 0.33. For different types of data, the value of f0 is different.
[0286] In the above formulas (12) to (13), when H0(f)≈1 in the selected frequency domain interval, the data of the decompressed frame in the selected frequency domain interval can be restored to the initial frame; when H0(f)>1 in the selected frequency domain interval, the data of the decompressed frame in the selected frequency domain interval can be enhanced, that is, the amplitude of the decompressed frame in the selected area is higher than that of the initial frame. For example, if the initial frame is a frame in the video, as long as H0(f) is greater than 1 in the selected frequency domain interval, clarity enhancement can be achieved. For the convenience of description, we define H0(f)≈1 as the normal mode and H0(f)>1 as the enhanced mode. Below we will take video data as an example to explain the overall spectrum adjustment function H0(f) in detail.
[0287] Fig. 12A A curve diagram of an overall adjustment function H0(f) provided according to an embodiment of the present specification is shown. Fig. 12B A curve diagram of an overall adjustment function H0(f) provided according to an embodiment of the present specification is shown. Fig. 12C A curve diagram of an overall adjustment function H0(f) provided according to an embodiment of the present specification is shown. Fig.12D A curve diagram of an overall adjustment function H0(f) provided according to an embodiment of the present specification is shown. Fig.12E FIG. 4 shows a graph of an overall adjustment function H0(f) provided according to an embodiment of the present specification. Figures 12A to 12E As shown, the horizontal axis is the normalized frequency f, and the vertical axis is the amplitude adjustment gain H0 of the overall spectrum adjustment function H0(f). Figures 12A to 12E The curves in the figure represent different overall spectrum adjustment functions H0(f). The maximum value of the normalized frequency on the horizontal axis is 0.5. The normalized frequency f on the horizontal axis can be divided into a low-frequency region, a medium-low-frequency region, a medium-frequency region, a medium-high-frequency region and a high-frequency region. The frequencies between (0, a] belong to low frequencies; the frequencies between (a, b] belong to medium-low frequencies; the frequencies between (b, c] belong to medium frequencies; the frequencies between (c, d] belong to medium-high frequencies; the frequencies between (d, 0.5] belong to high frequencies. The values of a, b, c, d, and e are referenced to Fig. 8A The above is not repeated here.
[0288] Since the human eye is more sensitive to low-frequency to medium-frequency data in video data than to high-frequency data, after the data is decompressed, the information of the low-frequency to medium-frequency region of the decompressed frame relative to the initial frame should be kept intact as much as possible. In other words, the overall spectrum adjustment function H0(f) should make the amplitude of the decompressed frame in the low-frequency to medium-frequency region not less than 85% of the initial frame, and can even be greater than the initial frame. Since the human eye is not sensitive to information in the high-frequency region, the amplitude of the decompressed frame in the high-frequency region can be selected according to different application scenarios. For example, in a scenario with low clarity requirements, the amplitude of the decompressed frame in the high-frequency region can be smaller than that of the initial frame. In a reconnaissance scenario with very high clarity requirements, the amplitude of the decompressed frame in the high-frequency region can be approximately equal to or greater than the initial frame. Figures 12A to 12EAs shown, the amplitude adjustment gain H0 of the overall adjustment function H0 (f) at any frequency f in the low-frequency to medium-frequency region (including the low-frequency and medium-frequency regions) is greater than 1 or approximately equal to 1, so that the amplitude of the decompressed frame after decompression is not less than 85% of the initial frame, so that the clarity is restored or enhanced, and the visual observation effect is improved. The approximately equal to 1 here can be fluctuating within a certain error range equal to 1. The error range can be within the interval specified by any two of the values of 0, ±1%, ±2%, ±3%, ±4%, ±5%, ±6%, ±7%, ±8%, ±9%, ±10%, ±11%, ±12%, ±13%, ±14%, ±15%, etc. For the convenience of description, we define the amplitude adjustment gain of the overall adjustment function H0 (f) in the high-frequency region as the first amplitude adjustment gain, the amplitude adjustment gain in the medium-frequency region as the second amplitude adjustment gain, and the amplitude adjustment gain in the low-frequency region as the third amplitude adjustment gain. The third amplitude adjustment gain value, the second amplitude adjustment gain value and the first amplitude adjustment gain value may fluctuate within the error range.
[0289] like Fig. 12A As shown, the third amplitude adjustment gain value, the second amplitude adjustment gain value and the first amplitude adjustment gain value of the overall adjustment function H0(f) in the low-frequency to high-frequency region are all approximately equal to 1, so that the amplitude of the decompressed frame in the low-frequency to high-frequency region is no less than 85% of the initial frame, so that the data of the decompressed frame in the low-frequency to high-frequency region can be smoothly restored or basically restored to the state of the initial frame.
[0290] like Fig. 12B As shown, the third amplitude adjustment gain value and the second amplitude adjustment gain value of the overall adjustment function H0(f) in the low-frequency to medium-frequency region are approximately equal to 1, so that the data of the decompressed frame in the low-frequency to medium-frequency region can be smoothly restored or basically restored to the state of the initial frame. The first amplitude adjustment gain value of the overall adjustment function H0(f) in the high-frequency region is less than 1, so that the amplitude of the decompressed frame in the high-frequency region is steadily reduced relative to the initial frame to suppress high-frequency noise. The steady reduction of the amplitude can be that the amplitude is attenuated by the first amplitude adjustment gain value, or that the amplitude is attenuated within a certain error range near the first amplitude adjustment gain value. For example, the first amplitude adjustment gain can be any value between 0 and 1. For example, the first amplitude adjustment gain value may be within the interval specified by any two of the values of 0, 0.04, 0.08, 0.12, 0.16, 0.20, 0.24, 0.28, 0.32, 0.36, 0.40, 0.44, 0.48, 0.52, 0.56, 0.60, 0.64, 0.68, 0.72, 0.76, 0.80, 0.84, 0.88, 0.92, 0.96 and 1. Fig. 12BAs shown, the first amplitude adjustment gain of the overall adjustment function H0(f) in the high frequency region (approximately the interval of 0.4 to 0.5) is about 0.6. The second and third amplitude adjustment gain values are both near 1. The second and third amplitude adjustment gain values can fluctuate within a certain error range, for example, the second and third amplitude adjustment gain values can be within the interval specified by any two of the values of 0.85, 0.90, 0.95, 1, 1.05, 1.10, and 1.15.
[0291] like Fig. 12C As shown, the third amplitude adjustment gain value of the overall adjustment function H0(f) in the low-frequency region is approximately equal to 1, so that the data of the decompressed frame in the low-frequency region can be smoothly restored or basically restored to the state of the initial frame. The second amplitude adjustment gain value of the overall adjustment function H0(f) in the intermediate frequency region and the first amplitude adjustment gain value in the high frequency region are both greater than 1, so that the amplitude of the decompressed frame in the intermediate frequency to high frequency region increases steadily relative to the initial frame, thereby enhancing the data clarity in the intermediate frequency to high frequency region. The steady increase in the amplitude can be that the amplitude is enhanced by the second amplitude adjustment gain value and the first amplitude adjustment gain value, or that the amplitude is enhanced within a certain error range near the second amplitude adjustment gain value and the first amplitude adjustment gain value. The second amplitude adjustment gain value and the first amplitude adjustment gain value can be roughly the same in size, or the second amplitude adjustment gain value can be greater than the first amplitude adjustment gain value, or the second amplitude adjustment gain value can be less than the first amplitude adjustment gain value. Fig. 12C In the curve shown, the second amplitude adjustment gain value and the first amplitude adjustment gain value are substantially the same in magnitude. The second amplitude adjustment gain value and the first amplitude adjustment gain value can be any value greater than 1. For example, the second amplitude adjustment gain value and the first amplitude adjustment gain value can be within the interval specified by any two of the values 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.1, 2.2 and 2.4. Fig. 12C As shown, the second amplitude adjustment gain and the first amplitude adjustment gain of the overall adjustment function H0(f) in the medium frequency to high frequency region are about 1.2.
[0292] like Fig.12DAs shown, the third amplitude adjustment gain value of the overall adjustment function H0(f) in the low-frequency region is approximately equal to 1, so that the data of the decompressed frame in the low-frequency region can be smoothly restored or basically restored to the state of the initial frame. The second amplitude adjustment gain value of the overall adjustment function H0(f) in the medium-frequency region is greater than 1, so that the amplitude of the decompressed frame in the medium frequency increases steadily relative to the initial frame, thereby enhancing the data clarity in the medium-frequency region. The first amplitude adjustment gain value of the overall adjustment function H0(f) in the high-frequency region is less than 1, so that the amplitude of the decompressed frame in the high-frequency region decreases steadily relative to the initial frame, thereby reducing the amount of data in the insensitive high-frequency region to suppress high-frequency noise. Fig.12D The curve shown can reduce the amount of data while enhancing clarity. The second amplitude adjustment gain value can be any value greater than 1. The first amplitude adjustment gain can be any value between 0 and 1. Fig.12D As shown, the second amplitude adjustment gain of the overall adjustment function H0(f) in the intermediate frequency region is about 1.2, and the first amplitude adjustment gain in the high frequency region is about 0.6.
[0293] like Fig.12E As shown, the third amplitude adjustment gain value of the overall adjustment function H0(f) in the low-frequency region is greater than 1, so that the amplitude of the decompressed frame in the low-frequency region increases steadily relative to the initial frame. The second amplitude adjustment gain value of the overall adjustment function H0(f) in the medium-frequency region is greater than 1, so that the amplitude of the decompressed frame in the medium-frequency region increases steadily relative to the initial frame, thereby enhancing the data clarity in the low-frequency to medium-frequency region. The second amplitude adjustment gain value may be equal to the third amplitude adjustment gain value, or may be greater than the third amplitude adjustment gain value. Fig.12E In the curve shown, the second amplitude adjustment gain value is greater than the third amplitude adjustment gain value, so that the amplitude increase of the decompressed frame in the intermediate frequency region is greater than the amplitude increase of the low frequency region, thereby enhancing the clarity of the intermediate frequency region where the human eye is most sensitive, and improving the visual observation effect. The first amplitude adjustment gain value of the overall adjustment function H0(f) in the high frequency region is less than 1, so that the amplitude of the decompressed frame in the high frequency region is steadily reduced relative to the initial frame, thereby reducing the amount of data in the insensitive high frequency region to suppress high frequency noise. Fig.12EThe curve shown can enhance clarity while reducing the amount of data. The third amplitude adjustment gain value can be a value slightly greater than 1. For example, the third amplitude adjustment gain value can be within the interval specified by any two of the values 1, 1.04, 1.08, 1.12, 1.16 and 1.2. The second amplitude adjustment gain value can be any value greater than the third amplitude adjustment gain. For example, the second amplitude adjustment gain value and the first amplitude adjustment gain value can be within the interval specified by any two of the values 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.1, 2.2 and 2.4. The first amplitude adjustment gain can be any value between 0 and 1. For example, the first amplitude adjustment gain value may be within the interval specified by any two of the values of 0, 0.04, 0.08, 0.12, 0.16, 0.20, 0.24, 0.28, 0.32, 0.36, 0.40, 0.44, 0.48, 0.52, 0.56, 0.60, 0.64, 0.68, 0.72, 0.76, 0.80, 0.84, 0.88, 0.92, 0.96 and 1. Fig.12E As shown, the third amplitude adjustment gain of the overall adjustment function H0(f) in the low-frequency region is about 1.1, the second amplitude adjustment gain in the medium-frequency region is about 1.2, and the first amplitude adjustment gain in the high-frequency region is about 0.6.
[0294] Furthermore, when the high frequency region is not connected to the intermediate frequency region, the overall spectrum adjustment function H0(f) can also adjust the amplitude in the high frequency region so that the amplitude adjustment gain changes smoothly and continuously in the intermediate and high frequency region.
[0295] Furthermore, when the mid-frequency region is not connected to the low-frequency region, the overall spectrum adjustment function H0(f) can also adjust the amplitude in the mid- and low-frequency region so that the amplitude adjustment gain changes continuously in the mid- and low-frequency region.
[0296] The curve of the overall adjustment function H0(f) is a curve of smooth transition. In engineering implementation, on the basis of realizing that the amplitude of the decompressed frame in the low-frequency to medium-frequency region is approximately equal to or greater than that of the initial frame, the curve of the overall adjustment function H0(f) can be allowed to fluctuate in a small range, and the fluctuation does not affect the decompression effect. For data in other forms besides video data, the parameters of the overall adjustment function H0(f) can be set according to the receiver's sensitivity to the data. For different forms of data, the receiver's sensitivity to frequency is different.
[0297] For the convenience of description, we will take the case shown in formula (13) as an example. Combining formula (8) and formula (13), the decompressed frame P4 can be expressed as the following formula:
[0298]
[0299] At this time, the relationship between the encoding spectrum adjustment function H1(f) corresponding to the encoding convolution kernel and the decoding spectrum adjustment function H2(f) corresponding to the decoding convolution kernel can be expressed as the following formula:
[0300]
[0301] Therefore, the relationship between H1(f) and H2(f) can be expressed as the following formula:
[0302]
[0303] Among them, since in the decoding spectrum adjustment function H2(f), except for the amplitude adjustment gain of the part with frequency 0 is 1, the amplitude adjustment gains of other frequencies are all less than 1, so the value of 1 / (1+b(1-H2(f))) at other frequencies except frequency 0 is less than 1. Therefore, formula (16) can ensure that the amplitude adjustment gain of the part with frequency 0 in the encoding spectrum adjustment function H1(f) is 1, and the amplitude adjustment gains corresponding to other frequencies are less than 1.
[0304] As mentioned above, if the initial frame undergoes convolution in multiple directions, the decoded frame also undergoes convolution in multiple directions, and the direction and order of the decoded frame during convolution are opposite to those of the initial frame during convolution. That is, the initial frame first undergoes convolution in the vertical direction and then in the horizontal direction, and the decoded frame first undergoes convolution in the horizontal direction and then in the vertical direction. It should be noted that the decoded frame must first undergo convolution in the horizontal direction to obtain compensation information in the horizontal direction, and after superimposing the compensation information in the horizontal direction of the decoded frame with the decoded frame, a convolution in the vertical direction is performed to obtain compensation information in the vertical direction, and the compensation information in the vertical direction of the decoded frame is superimposed with the decoded frame.
[0305] Fig.13A A graph showing an overall adjustment function H0(f), a coding spectrum adjustment function H1(f) and a decoding spectrum adjustment function H2(f) in a normal mode provided according to an embodiment of the present specification is shown. Fig. 13B A graph showing an overall adjustment function H0(f), a coding spectrum adjustment function H1(f) and a decoding spectrum adjustment function H2(f) of an enhancement mode provided according to an embodiment of the present specification is shown. Fig.13A and Fig. 13BThe encoding convolution kernel used in is the same as the decoding convolution kernel, and the adjustment coefficient b is the same. Fig.13A and Fig. 13B In the following, b=1.5 is used as an example. Fig.13A and Fig. 13B As shown, the horizontal axis is the normalized frequency f, and the vertical axis is the amplitude adjustment gain H. Fig.13A As shown, in any frequency region, the overall spectrum adjustment function H0(f)≈1, and the overall spectrum adjustment function H0(f) performs normal mode spectrum adjustment on the superimposed decompressed frame, that is, the information of all frequencies in the overall spectrum adjustment function H0(f) is completely retained, and the data in the decompressed frame can be basically restored to the data in the initial frame. Fig. 13B As shown, the overall spectrum adjustment function H0(f) in the low-frequency region is ≈1, and the overall spectrum adjustment function H0(f) in the medium-frequency to high-frequency region is >1. The overall spectrum adjustment function H0(f) performs spectrum adjustment in an enhanced mode on the medium-frequency to high-frequency region of the decompressed frame, that is, the overall spectrum adjustment function H0(f) enhances the information in the medium-frequency to high-frequency region, and the data in the medium-frequency to high-frequency region in the decompressed frame is enhanced compared to the data in the medium-frequency to high-frequency region in the initial frame. It should be noted that Fig.13A and Fig. 13B The curves shown are only exemplary. Those skilled in the art should understand that the curves of H0(f), H1(f), and H2(f) are not limited to Fig.13A and Fig. 13B In the form shown, all H0(f), H1(f), and H2(f) curves that conform to formula (15) belong to the scope of protection of this specification. It should be pointed out that all linear combinations of decoding spectrum adjustment functions that conform to formula (15) Or a combination of coded spectrum adjustment functions Or the combination of linear combination and product combination belongs to the protection scope of this specification. Where i≥1, represents the linear combination of n functions, H 2i (f) represents the i-th function, k i Represents the weight corresponding to the i-th function. j≥1, represents the product combination of n functions, k j represents the weight corresponding to the jth function, H 2j (f) can be any function.
[0306] Table 7 shows a parameter table of a decoding convolution kernel provided according to an embodiment of this specification. Table 7 exemplarily lists the parameters of a decoding convolution kernel. The parameters of the decoding convolution kernel are all non-negative numbers, so that the data convolved by the decoding convolution kernel avoids the ringing effect. Table 7 is only an exemplary illustration, and those skilled in the art should know that the decoding convolution kernel is not limited to the parameters shown in Table 7, and all decoding convolution kernels that meet the aforementioned requirements belong to the scope of protection of this specification.
[0307]
[0308] Table 8 shows a parameter table of a normal mode coding convolution kernel provided according to an embodiment of the present specification. Table 8 exemplarily lists the parameters of a normal mode coding convolution kernel. The normal mode coding convolution kernel is based on the overall spectrum adjustment function H0(f) of the normal mode, and the decoding spectrum adjustment function H2(f) corresponding to the parameter table of the decoding convolution kernel shown in Table 7, and the obtained coding spectrum adjustment function H1(f) is obtained by Fourier transform. That is, the coding spectrum adjustment function H1(f) is obtained corresponding to H0(f)=1. The data compression device 200 and the data decompression device 300 use the normal mode coding convolution kernel shown in Table 8 and the decoding convolution kernel shown in Table 7 to make the data of the superimposed frame basically consistent with the data of the initial frame. Table 8 is only an exemplary illustration. Those skilled in the art should know that the normal mode coding convolution kernel is not limited to the parameters shown in Table 8, and all coding convolution kernels that meet the above requirements belong to the scope of protection of this specification.
[0309]
[0310] Table 9 shows a parameter table of a coding convolution kernel of an enhancement mode provided according to an embodiment of the present specification. The coding convolution kernel of the enhancement mode is based on the overall spectrum adjustment function H0(f) of the enhancement mode, and the decoding spectrum adjustment function H2(f) corresponding to the parameter table of the decoding convolution kernel shown in Table 7, and the obtained coding spectrum adjustment function H1(f) is obtained by Fourier transform. That is, the coding spectrum adjustment function H1(f) is obtained corresponding to H0(f)>1. The data compression device 200 uses the coding convolution kernel of the enhancement mode shown in Table 9 and the decoding convolution kernel shown in Table 7 to enhance the data of the superimposed frame. Table 9 is only an exemplary illustration, and those skilled in the art should know that the coding convolution kernel of the enhancement mode is not limited to the parameters shown in Table 9, and all coding convolution kernels that meet the aforementioned requirements belong to the scope of protection of this specification.
[0311]
[0312] It should be noted that after the convolution operation, normalization processing is required to make the grayscale value of the image after the convolution operation between 0 and 255.
[0313] It should be noted that, when the bit rate is very high, the noise in the decompressed frame is very small, and the above boundary correction may not be performed. When the bit rate is low, or in the enhanced mode, that is, the mode of H0(f)>1, excessive enhancement may cause noise to appear in the decompressed frame, affecting the visual observation effect. We can perform the boundary correction on the boundary of the decompressed frame to obtain the decompressed frame to effectively eliminate the noise.
[0314] Fig.14A An example diagram of a decompressed image without boundary correction provided according to an embodiment of the present specification is shown; Fig. 14B An example of a decompressed image after performing boundary correction according to an embodiment of the present specification is shown. Fig.14A and Fig. 14B It is found that the boundary correction method described in this specification can effectively eliminate noise.
[0315] To summarize, the data processing system 100 provided in the present specification, when compressing the initial data, executes method P200 through the data compression device 200, and adjusts the boundaries within a small range in the initial frame in the initial data through the first gamma algorithm to avoid the loss of boundary information with small differences between adjacent pixel values during the data compression process, and to avoid loss of details. At the same time, the method P200 uses a coding convolution kernel to adjust the coding spectrum of the initial frame, so that the amplitude of the initial frame from the low frequency to the high frequency region in the frequency domain is smoothly reduced, thereby reducing the data information in the initial frame, improving the coding efficiency, reducing the capacity of the compressed data, and improving the data compression efficiency and data transmission efficiency. The data processing system 100 provided in this specification, when decompressing the compressed frame, executes method P300 through the data decompression device 300, uses the decoding convolution kernel to perform decoding spectrum adjustment on the compressed frame, uses the decoding spectrum adjustment function H2(f) with smooth transition to perform spectrum adjustment on the compressed frame, filters the components from the intermediate frequency to the high frequency region in the compressed frame, and then takes the difference between the compressed frame and the compressed frame after the decoding spectrum adjustment to obtain the boundary information of the initial frame, and weakens the boundary within a small range in the boundary information of the initial frame by the second gamma algorithm to eliminate the noise in the boundary; superimposes the decoded frame with the boundary information after noise reduction to obtain the decompressed frame. Among them, the decoding convolution kernel corresponding to the decoding spectrum adjustment function H2(f) corresponds to the encoding convolution kernel, and all coefficients are non-negative numbers, or the ratio of the absolute value of the sum of negative coefficients to the sum of non-negative coefficients is less than 0.1, thereby effectively avoiding the appearance of noise and making the decompressed frame clearer. The method and system can improve data compression efficiency, increase transmission efficiency, and avoid detail loss. At the same time, they can improve the clarity of decompressed data and effectively eliminate noise.
[0316] This specification also provides a non-transitory storage medium, storing at least one set of executable instructions for data processing, when the executable instructions are executed by the processor, the executable instructions guide the processor to implement the steps of the data processing method P200. In some possible implementations, various aspects of this specification can also be implemented in the form of a program product, which includes a program code. When the program product is run on the data compression device 200, the program code is used to make the data compression device 200 perform the steps of data processing described in this specification. The program product for implementing the above method can use a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on the data compression device 200, such as a personal computer. However, the program product of this specification is not limited to this. In this specification, a readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system (such as a compression end processor 220) or used in combination with it. The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of readable storage media include: an electrical connection with one or more conductors, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. The computer-readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, device, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof. Program code for performing the operations of the present specification may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the data compression device 200, partially on the data compression device 200, as a stand-alone software package, partially on the data compression device 200 and partially on a remote computing device, or entirely on a remote computing device.In cases involving a remote computing device, the remote computing device may be connected to the data compression device 200 via the transmission medium 120, or may be connected to an external computing device.
[0317] The above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require a specific order or a continuous order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0318] In summary, after reading this detailed disclosure, those skilled in the art will appreciate that the foregoing detailed disclosure may be presented only by way of example and may not be limiting. Although not explicitly stated herein, those skilled in the art will appreciate that this specification requires various reasonable changes, improvements and modifications to the embodiments. These changes, improvements and modifications are intended to be proposed by this specification and are within the spirit and scope of the exemplary embodiments of this specification.
[0319] In addition, certain terms in this specification have been used to describe embodiments of this specification. For example, "one embodiment", "an embodiment" and / or "some embodiments" mean that a particular feature, structure or characteristic described in conjunction with the embodiment may be included in at least one embodiment of this specification. Therefore, it can be emphasized and should be understood that two or more references to "an embodiment" or "one embodiment" or "an alternative embodiment" in various parts of this specification do not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics may be appropriately combined in one or more embodiments of this specification.
[0320] It should be understood that in the foregoing description of the embodiments of this specification, in order to help understand a feature and for the purpose of simplifying this specification, this specification combines various features in a single embodiment, drawing or its description. However, this does not mean that the combination of these features is necessary. When reading this specification, it is entirely possible for a person skilled in the art to extract some of the features and understand them as separate embodiments. In other words, the embodiments in this specification can also be understood as the integration of multiple secondary embodiments. This is also true when the content of each secondary embodiment is less than all the features of a single aforementioned disclosed embodiment.
[0321] Each patent, patent application, patent application publication, and other material, such as articles, books, specifications, publications, documents, articles, etc., cited herein may be incorporated herein by reference in its entirety for all purposes, except for any prosecution document history related thereto, any equivalent that may be inconsistent or conflicting with this document, or any equivalent prosecution document history that may have a limiting effect on the broadest scope of the claims now or later associated with this document. For example, if there is any inconsistency or conflict between the description, definition, and / or use of a term associated with any of the incorporated materials and the term, description, definition, and / or use associated with this document, the term in this document shall control.
[0322] Finally, it should be understood that the embodiments of the application disclosed herein are explanations of the principles of the embodiments of this specification. Other modified embodiments are also within the scope of this specification. Therefore, the embodiments disclosed in this specification are only used as examples and not as limitations. Those skilled in the art can adopt alternative configurations according to the embodiments in this specification to implement the applications in this specification. Therefore, the embodiments of this specification are not limited to the embodiments accurately described in the application.
Claims
1. A method for data processing, characterized in that: include: Selecting an initial frame in the initial data, wherein the initial frame includes initial data of a preset number of bytes; as well as The initial frame is subjected to data compression to obtain a compressed frame, wherein the data compression includes adjusting the boundary of the initial frame and adjusting the coding spectrum of the compressed frame, and the compressed frame includes the initial frame and data in any data state before the initial frame becomes the compressed frame during the data compression process. Among them, the coding spectrum adjustment includes using a coding convolution kernel to convolve the compressed frame so as to smoothly reduce the amplitude of the intermediate frequency region of the compressed frame in the frequency domain, and the boundary adjustment includes adjusting the part of the boundary of the initial frame whose boundary value is within a first preset range.
2. The data processing method according to claim 1, characterized in that: The boundary adjustment includes adjusting a boundary whose boundary value is within the first preset range among the boundaries of the initial frame by using a first gamma algorithm whose gamma value is less than 1.
3. The data processing method according to claim 2, characterized in that: The step of compressing data of the initial frame comprises: Firstly, the boundary adjustment is performed on the initial frame, and then the coding spectrum adjustment is performed; or The coding spectrum adjustment is performed on the initial frame first, and then the boundary adjustment is performed.
4. The data processing method according to claim 3, characterized in that: The step of first adjusting the boundary of the initial frame and then adjusting the coding spectrum includes: Performing the boundary adjustment on the initial frame to obtain a first enhanced frame; and The coding spectrum adjustment and coding of the first enhanced frame include one of the following methods: Firstly, the coding spectrum is adjusted on the first enhanced frame, and then prediction and residual are performed on the first enhanced frame after the coding spectrum adjustment, wherein the compressed frame includes the first enhanced frame; Predicting the first enhanced frame to obtain a predicted frame, and then performing the coding spectrum adjustment and residual calculation on the first enhanced frame and the predicted frame, wherein the compressed frame includes the first enhanced frame and the predicted frame; and The first enhanced frame is first predicted and a residual is calculated, and then the coding spectrum is adjusted for the residual, wherein the compressed frame includes the residual.
5. The data processing method according to claim 4, characterized in that: The step of performing the boundary adjustment on the initial frame to obtain a first enhanced frame includes: The initial frame is adjusted by a first adjustment function to obtain a first frame, so that the components of the initial frame in the low-frequency region in the frequency domain are retained and the components in the medium-frequency to high-frequency region are attenuated; Subtracting the initial frame from the first frame to obtain a first boundary, where the first boundary includes boundary information of the initial frame; By using the first gamma algorithm, adjusting the boundaries of the first boundaries whose boundary values are within the first preset range to obtain enhanced boundaries; and The first frame is superimposed with the enhanced boundary to obtain the first enhanced frame.
6. The data processing method according to claim 5, characterized in that: Before obtaining the enhanced boundary, performing the boundary adjustment on the initial frame to obtain the first enhanced frame further includes: The first boundary is enhanced by a first coefficient, wherein the first coefficient is any number greater than 1, and the first boundary includes a boundary enhanced by the first coefficient.
7. The data processing method according to claim 5, characterized in that: The step of adjusting the boundary of the first boundary whose boundary value is within the first preset range to obtain an enhanced boundary includes: The first boundary is adjusted by a second adjustment function to obtain a second boundary, so that the component of the first boundary in the low-frequency region in the frequency domain is retained and the component in the medium-frequency to high-frequency region is attenuated; and The enhanced boundary is obtained by adjusting the boundary of the second boundary whose boundary value is within the first preset range through the first gamma algorithm.
8. The data processing method according to claim 3, characterized in that: The step of first adjusting the coding spectrum of the initial frame and then adjusting the boundary comprises: Performing the coding spectrum adjustment on the initial frame to obtain a coding spectrum adjustment frame; performing the boundary adjustment on the coded spectrum adjustment frame to obtain a second enhanced frame; and The second enhanced frame is predicted and a residual is calculated.
9. The data processing method according to claim 8, characterized in that: The step of performing the boundary adjustment on the coded spectrum adjustment frame to obtain a second enhanced frame includes: Subtracting the initial frame from the coded spectrum adjustment frame to obtain a first boundary, wherein the first boundary includes boundary information of the initial frame; By using the first gamma algorithm, adjusting the boundaries of the first boundaries whose boundary values are within the first preset range to obtain enhanced boundaries; Subtracting the enhancement boundary from the first boundary to obtain an adjustment value; and The coded spectrum adjustment frame and the adjustment value are superimposed to obtain the second enhanced frame.
10. The data processing method according to claim 9, characterized in that: Before obtaining the enhanced boundary, performing the boundary adjustment on the coded spectrum adjustment frame to obtain a second enhanced frame further includes: The first boundary is enhanced by a first coefficient, wherein the first coefficient is any number greater than 1, and the first boundary includes a boundary enhanced by the first coefficient.
11. The data processing method according to claim 9, characterized in that: The step of adjusting the boundary of the first boundary whose boundary value is within the first preset range to obtain an enhanced boundary includes: The first boundary is adjusted by a second adjustment function to obtain a second boundary, so that the component of the first boundary in the low-frequency region in the frequency domain is retained and the component in the medium-frequency to high-frequency region is attenuated; and The enhanced boundary is obtained by adjusting the boundary of the second boundary whose boundary value is within the first preset range through the first gamma algorithm.
12. The data processing method according to claim 1, characterized in that: The step of adjusting the coding spectrum of the compressed frame includes: Determining a frame type of the initial frame, the frame type comprising at least one of an intra-frame prediction frame, a forward prediction frame, and a bidirectional prediction frame; and Based on the frame type of the initial frame, a convolution kernel is selected from a coding convolution kernel group as the coding convolution kernel to perform convolution on the compressed frame.
13. The data processing method according to claim 12, characterized in that: The performing convolution on the compressed frame includes: The compressed frame is convolved in at least one direction among a vertical direction, a horizontal direction and a diagonal direction.
14. The data processing method according to claim 1, characterized in that: The coding spectrum adjustment enables the amplitude of the high frequency region of the compressed frame to be smoothly reduced in the frequency domain.
15. The data processing method according to claim 1, characterized in that: The coding spectrum adjustment is to smoothly reduce the amplitude of the low frequency region of the compressed frame in the frequency domain, and The amplitude reduction degree of the low-frequency region of the compressed frame caused by the coding spectrum adjustment is lower than the amplitude reduction degree of the medium-frequency region.
16. The data processing method according to claim 1, characterized in that: The amplitude adjustment gain of the encoded spectrum adjustment on any frequency in the frequency domain of the compressed frame is greater than zero.
17. A data processing system, characterized in that: include: at least one storage medium storing at least one instruction set for data processing; as well as at least one processor, in communication with the at least one storage medium, Wherein, when the system is running, the at least one processor reads the at least one instruction set and executes the data processing method according to any one of claims 1 to 16 according to the instructions of the at least one instruction set.
18. A method of data processing, characterized in that: include: Acquire compressed data, wherein the compressed data includes a compressed frame obtained by compressing the initial frame, wherein the data compression includes adjusting the coding spectrum of the compressed frame; as well as Decompressing the compressed frame to obtain a decompressed frame, wherein the data decompression includes decoding spectrum adjustment and boundary correction on the decompressed frame, wherein the decompressed frame includes the compressed frame and data in any data state before the compressed frame becomes the decompressed frame during the data decompression process, wherein: The decoding spectrum adjustment includes convolving the de-frame with a decoding convolution kernel so that the amplitude of the de-frame in the frequency domain is smoothly reduced to filter the components in the intermediate frequency to high frequency region, and the encoding spectrum adjustment has a preset correlation relationship with the decoding spectrum adjustment. The boundary correction includes correcting a portion of the boundary whose boundary value in the deframed boundary is within a second preset range.
19. The data processing method according to claim 18, characterized in that: The boundary correction includes correcting the boundary whose boundary value is within a second preset range in the boundary of the deframe by a second gamma algorithm; The second gamma algorithm includes a gamma algorithm with a gamma value greater than 1, so as to weaken the boundary whose boundary value is within the second preset range in the boundary of the deframing.
20. The data processing method according to claim 19, characterized in that: The step of decompressing the compressed frame includes: Performing the decoding spectrum adjustment on the decoding frame to obtain a decoding spectrum adjustment frame; Difference is calculated between the decoded frame and the decoded spectrum adjustment frame to obtain a third boundary, where the third boundary is the boundary of the decoded frame, including boundary information of the initial frame; Using the second gamma algorithm, weakening the boundaries of the third boundaries whose boundary values are within the second preset range, so as to reduce noise on the third boundaries and obtain a reduced-noise boundary; and The decompressed frame is obtained by superimposing the noise reduction boundary and the decompressed frame.
21. The data processing method according to claim 20, characterized in that: Before obtaining the noise reduction boundary, decompressing the compressed frame includes: The third boundary is enhanced by a second coefficient, wherein the second coefficient is any number greater than 1, and the third boundary includes the boundary enhanced by the second coefficient.
22. The data processing method according to claim 20, characterized in that: The step of weakening the boundary whose boundary value is within the second preset range in the third boundary by the second gamma algorithm to reduce noise on the third boundary to obtain the reduced noise boundary includes: The third boundary is adjusted by a third adjustment function to obtain a fourth boundary, so that the components of the third boundary in the low-frequency region in the frequency domain are retained and the components in the medium-frequency to high-frequency region are filtered; and The second gamma algorithm is used to weaken the boundaries of the fourth boundary whose boundary values are within the second preset range.
23. The data processing method according to claim 20, characterized in that: Before performing the decoding spectrum adjustment on the de-frame to obtain the decoded spectrum adjusted frame, the data decompression on the compressed frame further includes: The compressed frame is decoded to obtain a decoded frame, and the decoded frame includes the decoded frame.
24. The data processing method according to claim 18, characterized in that: The coding spectrum adjustment includes convolving the compressed frame with a coding convolution kernel so as to smoothly reduce the amplitude of the compressed frame in the intermediate frequency region in the frequency domain, wherein the compressed frame includes the initial frame and any data state of the initial frame before it becomes the compressed frame during the data compression process. Among them, the decoding convolution kernel corresponds to the encoding convolution kernel.
25. A data processing system, characterized in that: include: at least one storage medium storing at least one instruction set for data processing; as well as at least one processor, in communication with the at least one storage medium, Wherein, when the system is running, the at least one processor reads the at least one instruction set and executes the data processing method as described in any one of claims 18-24 according to the instructions of the at least one instruction set.
Citation Information
Patent Citations
Encoding device and encoding method
US20150131748A1