Processing device, processing method, and processing program
By calculating average values to determine optimal Golomb encoding parameters, the method addresses inefficiencies in parameter selection, enhancing encoding efficiency and reducing computational complexity.
Patent Information
- Application Number
- JP2023062721
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-04-07
- Publication Date
- 2024-10-18
AI Technical Summary
Existing methods for selecting parameters in Golomb encoding are cumbersome and may result in inappropriate parameter selection, leading to inefficient encoding.
A processing device calculates an average value of data within a predetermined reference range and uses this to determine optimal parameters for Golomb encoding, facilitating efficient encoding by converting prediction differences into Golomb codes.
This approach allows for easy and appropriate calculation of parameters in Golomb encoding, improving compression efficiency and reducing computational burden.
Smart Images

Figure 2024149053000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a technique for compressing data. [Background technology]
[0002] Conventionally, compression processing has been performed to reduce the amount of data. For example, Golomb coding (see, for example, Non-Patent Document 1) is known as a technique for coding an integer data string that follows a geometric distribution with a small amount of code.
[0003] In addition, in Golomb coding, conditions regarding the geometric distribution that enable the most efficient coding are disclosed in, for example, Non-Patent Document 2.
[0004] In order to perform efficient coding using Golomb coding, it is necessary to appropriately select parameters used in Golomb coding.
[0005] For example, Non-Patent Document 3 discloses a technique for selecting parameters in Rice coding in which the parameters in Golomb coding are limited to some parameters (parameters that are powers of 2).
[0006] In addition, as a method for detecting parameters in Golomb coding, a technology has been disclosed in which data features are calculated based on post-coding feature information, which is the amount of information after coding into a code different from the Golomb code, and the Golomb parameters are calculated using the data features (see, for example, Patent Document 1). [Prior art documents] [Patent documents]
[0007] [Patent Document 1] JP 2020-57904 A [Non-patent literature]
[0008] [Non-Patent Document 1] SW Golomb, “Run-Length Encodings,” IEEE Transactions on Information Theory, vol. IT-12, no. 3, pp. 399-401, July 1966. [Non-Patent Document 2] RG Gallager and DC Van Voorhis, “Optimal Source Codes for Geometrically Distributed Integer Alphabets,” IEEE Transactions on Information Theory, vol. IT-21, no. 2, pp. 228-230, March 1975. [Non-Patent Document 3] Kiely, Aaron. “Selecting the Golomb parameter in Rice coding,” IPN progress report 42 (2004): 159. Summary of the Invention [Problem to be solved by the invention]
[0009] The technology of Non-Patent Document 3 is a technology for selecting appropriate parameters from among some limited parameters in Golomb coding, and there is a risk that appropriate parameters in Golomb coding cannot be selected. In addition, according to Patent Document 1, there is a problem that a load is imposed on the process of calculating parameters.
[0010] The present invention has been made in consideration of the above circumstances, and an object of the present invention is to provide a technique that can easily and appropriately calculate parameters in Golomb coding. [Means for solving the problem]
[0011] In order to achieve the above-mentioned object, a processing device according to one aspect, in a processing device that performs processing according to a Golomb code, has an average value calculation unit that calculates an average value of data before encoding in a specified reference range corresponding to a processing target range of data to be processed, and a parameter calculation unit that calculates parameters of the Golomb code for the processing target range based on the average value. Effect of the Invention
[0012] According to the present invention, parameters in Golomb coding can be easily and appropriately calculated. [Brief description of the drawings]
[0013] [Figure 1] FIG. 1 is a diagram showing the overall configuration of a processing system according to an embodiment. [Diagram 2] FIG. 2 is a diagram illustrating a graph of a calculation formula for parameters of Golomb coding according to an embodiment. [Diagram 3] FIG. 3 is a diagram illustrating another calculation formula for the parameters according to an embodiment. [Figure 4] FIG. 4 is a flowchart of an encoding process according to an embodiment. [Diagram 5] FIG. 5 is a flowchart of a decoding process according to an embodiment. [Figure 6] FIG. 6 is a diagram illustrating the configuration of a computer device according to an embodiment. [Figure 7] FIG. 7 is a flowchart of a decoding process according to a modified example. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0014] The following embodiments will be described with reference to the drawings. Note that the following embodiments do not limit the scope of the invention, and not all of the elements and combinations thereof described in the embodiments are necessarily essential to the solution of the invention.
[0015] First, a processing system according to an embodiment will be described.
[0016] FIG. 1 is a diagram showing the overall configuration of a processing system according to an embodiment.
[0017] The processing system 1 includes an encoder 10 as an example of a processing device, and a decoder 30 as an example of a processing device. The encoder 10 and the decoder 30 are connected via a network 50. The network 50 is, for example, a Local Area Network (LAN) or a Wide Area Network (WAN).
[0018] The encoder 10 includes a target data input unit 11, a prediction difference calculation unit 12, a Golomb code encoding unit 13, and a compressed data output unit 14. Here, the target data input unit 11 is an example of a target data receiving unit, the prediction difference calculation unit 12 is an example of a transformation unit, and the Golomb code encoding unit 13 is an example of an average value calculation unit and a parameter calculation unit.
[0019] The target data input unit 11 inputs data to be compressed. The target data may be, for example, audio data converted by PCM (Pulse Code Modulation). The target data may be obtained from the auxiliary storage device 106 (see FIG. 6) in the encoder 10, or may be obtained from a recording device (not shown).
[0020] The prediction difference calculation unit 12 performs a process of calculating a prediction difference for each data element (data at a predetermined point in time) of the audio data. An example of the process of calculating the prediction difference will be described below.
[0021] Here, a data string of frames (division units) obtained by dividing audio data every predetermined length n is denoted by x[t], where t=0, 1, 2, . . . , n-1, and x[t] is an integer. When the prediction difference x'[t] of x[t] is predicted using the previous data x[t-1], the prediction difference x'[t] can be expressed as shown in the following equation (2).
[0022]
number
[0023] The Golomb code encoding unit 13 converts the prediction difference x'[t] calculated by the prediction difference calculation unit 12 into conversion target data p[t] (processing target data: processing target range) to be subjected to Golomb coding, using the following equation (3). p[t] = g(x'[t]) (3) Here, g() is a function that maps positive and negative integers to non-negative integers, and can be expressed as shown in equation (4).
[0024]
number
[0025] The Golomb coding unit 13 calculates the average value μ of the conversion target data p[t] (data in the reference range) by the following formula (5).
[0026]
number
[0027] Next, the Golomb coding unit 13 calculates a parameter m for performing Golomb coding by the following equation (6).
[0028]
number
[0029] Next, the derivation of equation (6) will be explained.
[0030] For example, the data p[t] to be transformed can be treated as a non-negative integer whose probability mass function shown in the following equation (7) follows a geometric distribution.
[0031]
number
[0032] Here, θ means the probability that p[t] outputs a value other than 0, and 0<θ<1.
[0033] In this case, the expected value (average value) E(t) of p[t] can be expressed as shown in equation (8).
[0034]
number
[0035] Here, considering that the actual average value μ of p[t] coincides with E(t) in equation (8), θ can be expressed as shown in the following equation (9).
[0036]
number
[0037] On the other hand, the known technology described in Non-Patent Document 2 discloses that Golomb coding is optimal when the parameter m of Golomb coding satisfies the relationship shown in the following equation (10).
[0038]
number
[0039] By substituting θ from equation (9) into equation (10) and modifying it, the parameter m for optimizing Golomb coding can be expressed as shown in the following equation (11).
[0040]
number
[0041] Next, the relationship between the parameter m and the average value μ according to the parameter calculation formulas shown in Equations (11) and (6) will be shown.
[0042] FIG. 2 is a diagram illustrating a graph of a calculation formula for parameters of Golomb coding according to an embodiment.
[0043] The optimum lower limit equation (the equation on the left side) of parameter m and the upper limit equation of parameter m shown in equation (11) can be expressed as shown in FIG.
[0044] Here, according to formula (10), it can be seen that the upper limit value of a certain parameter m becomes the lower limit value when the parameter m is increased by 1. From this, it can be seen that the optimal parameter m can be estimated by formula (6) focusing on the lower limit equation of parameter m in formula (11). It can be seen that the parameter m estimated by formula (6) satisfies formula (11), as shown in FIG. 2.
[0045] The optimal parameter m may be estimated by equation (13) using the following equation (12) which approximates the lower limit equation of equation (11).
[0046]
number
[0047] FIG. 3 is a diagram illustrating another calculation formula for the parameters according to an embodiment.
[0048] Equation (12) is a linear approximation of the lower limit equation of equation (11) as shown in Fig. 3. Equation (13) using equation (12) is an approximation of equation (6), and according to equation (13), it is possible to calculate a parameter m similar to that of equation (6) (the same or similar) for the same average value μ.
[0049] In addition, the approximation formula for the lower limit of formula (11) used to estimate parameter m is not limited to formula (12) and other approximation formulas may be used. In short, it is sufficient if it is an approximation formula that can calculate parameter m similar to formula (6) for the same average value μ.
[0050] Furthermore, the Golomb coding unit 13 performs coding processing to Golomb-code each element of the conversion target data p[t] in accordance with the estimated parameter m.
[0051] Here, Golomb coding is a coding method that codes an integer n using a parameter m according to the following algorithm: (a) Find the quotient p=n / m and the remainder q=n%m. (b) Code the quotient p with the α code. (c) When m is 2 k If m<2, add the lowest k bits of q to the code. k If , q is encoded using the CBT code and added to the code.
[0052] The compressed data output unit 14 creates compressed data in a file format that combines the encoded data obtained by Golomb encoding each frame and a parameter m in the Golomb encoding for each frame, and outputs the compressed data to the decoder 30. Here, the parameter m may be set in the header portion of the encoded data for each frame.
[0053] The decoder 30 includes a compressed data input unit 31, a Golomb code decoding unit 32, a target data calculation unit 33, and a target data processing unit 34. Here, the compressed data input unit 21 is an example of a compressed data receiving unit.
[0054] The compressed data input unit 31 inputs compressed data (data to be processed) transmitted from the encoder 10 via the network 50.
[0055] The Golomb code decoding unit 32 decodes the Golomb code for the encoded data for each frame included in the compressed data using the parameter m corresponding to that frame, thereby obtaining the data before encoding for each frame, i.e., the data to be converted p[t].
[0056] The target data calculation unit 33 calculates a prediction difference x'[t] for the conversion target data p[t] corresponding to each frame using the following equation (14), by performing the inverse mapping of the process of mapping positive and negative integers to non-negative integers using equation (4), i.e., the process of converting the non-negative integers back to the original positive and negative integers. x'[t]=g - (p[t]) (14) Here, g - () is a function that converts a non-negative integer into a positive or negative integer, and can be expressed as shown in equation (15).
[0057]
number
[0058] The target data calculation unit 33 performs the processing shown in equation (16) on the prediction difference x'[t] for each frame to restore the data sequence x[t] of each frame of the audio data, and creates the original audio data (data to be compressed) by synthesizing the data sequences x[t] of each frame.
[0059]
number
[0060] The target data processing unit 34 processes the created voice data to output voice.
[0061] Next, the processing operation in the processing system 1 will be described.
[0062] First, the encoding process by the encoder 10 will be described.
[0063] FIG. 4 is a flowchart of an encoding process according to an embodiment.
[0064] In the encoding process, first, the target data input unit 11 accepts audio data to be encoded (S11).
[0065] Next, the prediction difference calculation unit 12 determines each compression unit (frame: division unit) in the audio data (S12).
[0066] Next, the prediction difference calculation unit 12 determines whether or not all compression units have been processed (S13), and if not all processing units have been processed (step S13: N), the process proceeds to step S14 to execute processing on the compression units.
[0067] In step S14, the prediction difference calculation unit 12 performs a process of calculating a prediction difference x'[t] for each data element (data at each point in time) of the audio data in the target compression unit.
[0068] Next, the Golomb code encoding unit 13 converts the prediction difference x'[t] calculated by the prediction difference calculation unit 12 into conversion target data p[t] (data to be processed) to be subjected to Golomb encoding, calculates the average value μ of the conversion target data p[t], and estimates (determines) a parameter m for performing Golomb encoding based on the average value μ (S15).
[0069] Next, the Golomb coding unit 13 performs coding processing to Golomb-code the conversion target data p[t] in accordance with the estimated parameter m (S16).
[0070] Next, the compressed data output unit 14 creates compressed data for this frame by combining the encoded data obtained by Golomb encoding the frame and the parameter m in the Golomb encoding for this frame (S17), and the process proceeds to step S13.
[0071] On the other hand, if all the processing units have been processed (step S13: Y), the prediction difference calculation section 12 advances the process to step S18.
[0072] In step S18, the compressed data output unit 14 collects the compressed data for all the frames to generate compressed data for the entire audio data, and outputs (transmits) the compressed data to the decoder 30.
[0073] In this encoding process, parameters for Golomb encoding can be calculated easily and appropriately, and the compression efficiency of audio data can be improved.
[0074] Next, the decoding process by the decoder 30 will be described.
[0075] FIG. 5 is a flowchart of a decoding process according to an embodiment.
[0076] The compressed data input unit 31 inputs compressed data (an example of data to be processed) transmitted from the encoder 10 via the network 50 (step S31).
[0077] Next, the Golomb coder / decoder 32 determines coded data corresponding to each compression unit (frame: division unit) in the compressed data (S32).
[0078] Next, the Golomb code decoding unit 32 determines whether all compression units have been processed (S33), and if all processing units have not been processed (step S33: N), the process proceeds to step S34 to execute processing on the compression units.
[0079] In step S34, the Golomb code decoding unit 32 decodes the Golomb code for the encoded data of the compression unit using the parameter m corresponding to this compression unit, thereby obtaining the data before encoding, that is, the data to be transformed p[t].
[0080] Next, the target data calculation unit 33 converts the conversion target data p[t] into prediction difference x'[t], restores the prediction difference x'[t] to the original data sequence x[t] of each frame (S35), and proceeds to step S33.
[0081] On the other hand, if all the processing units have been processed (step S33: Y), the Golomb code decoding unit 32 advances the process to step S36.
[0082] In step S36, the target data calculation unit 33 puts together the data strings x[t] for all frames to create voice data, and the target data processing unit 34 performs voice output processing using the created voice data, and then the process ends.
[0083] According to the above-described decoding process, sound can be appropriately output based on the compressed data created by the encoder 10.
[0084] The above-mentioned encoder 10 and decoder 30 can each be configured by a computer device.
[0085] Fig. 6 is a configuration diagram of a computer device according to an embodiment. In this embodiment, the encoder 10 and the decoder 30 are configured as separate computer devices, but these computer devices may have the same configuration. Therefore, in the following description, for convenience, the computer device shown in Fig. 6 will be used to describe the computer device that configures the encoder 10 and the decoder 30.
[0086] The computer device 100 includes, for example, a central processing unit (CPU) 101, a main memory 102, a graphics processing unit (GPU) 103, a reader / writer 104, a communication interface (communication I / F) 105, an auxiliary storage device 106, an input / output interface (input / output I / F) 107, an output device 108, and an input device 109. The CPU 101, the main memory 102, the GPU 103, the reader / writer 104, the communication I / F 105, the auxiliary storage device 106, the input / output I / F 107, and the output device 108 are connected via a bus 110. The encoder 10 and the decoder 30 are each configured by appropriately selecting a part or all of the components described in the computer device 100.
[0087] In the computer device 100 constituting the encoder 10, a CPU 101 executes a processing program stored in an auxiliary storage device 106 to constitute, for example, a target data input unit 11, a prediction difference calculation unit 12, a Golomb code encoding unit 13, and a compressed data output unit 14.
[0088] In the computer device 100 constituting the decoder 30, the CPU 101 executes a processing program stored in the auxiliary storage device 106 to constitute, for example, a compressed data input unit 31, a Golomb coding decoding unit 32, a target data calculation unit 33, and a target data processing unit 34.
[0089] The main memory 102 is, for example, a RAM, a ROM, etc., and stores programs (processing programs, etc.) executed by the CPU 101 and various information. The auxiliary storage device 106 is, for example, a non-temporary storage device (non-volatile storage device) such as a Hard Disk Drive (HDD) or a Solid State Drive (SSD), and stores the programs executed by the CPU 101 and various information.
[0090] The GPU 103 is a processor that is suitable for executing a specific process, for example, a process that is performed in parallel. In this embodiment, the GPU 103 executes a predetermined process according to an instruction from the CPU 101.
[0091] The reader / writer 104 is detachably attached to the recording medium 111, and reads data from the recording medium 111 and writes data to the recording medium 111. The recording medium 111 may be, for example, a non-temporary recording medium (non-volatile recording medium) such as an SD memory card, an FD (floppy disk: registered trademark), a CD, a DVD, a BD (registered trademark), or a flash memory. In this embodiment, a processing program may be stored in the recording medium 111, and the reader / writer 104 may read and use the processing program. In the computer device 100 constituting the encoder 10, audio data to be processed may be stored in the recording medium 111, and the reader / writer 104 may read and use the processing program. In the computer device 100 constituting the encoder 10, the reader / writer 104 may store compressed data in the recording medium 111. In the computer device 100 constituting the decoder 30, the reader / writer 104 may read and use the compressed data from the recording medium 111.
[0092] The communication I / F 105 is connected to a network 50 , and transmits and receives data to and from other devices connected to the network 50 .
[0093] The input / output I / F 107 is connected to an input device 109 such as a mouse or a keyboard. In the computer device 100 constituting the encoder 10, the input / output I / F 107 accepts operation input by a user of the encoder 10 using the input device 109. Also, in the computer device 100 constituting the decoder 30, the input / output I / F 107 accepts operation input by a user of the decoder 30 using the input device 109.
[0094] The output device 108 is, for example, a display device such as a liquid crystal display or a speaker device, and outputs various types of information for display and sound. The output device 108 is used, for example, in the decoder 30, for outputting sound by the target data processing unit 34.
[0095] The present invention is not limited to the above-described embodiment and modified examples, and can be appropriately modified and implemented without departing from the spirit of the present invention.
[0096] For example, in the above embodiment, the range (reference range) for calculating the average value μ is the conversion target range. However, for example, when it is considered that there is a correlation between the average value of the conversion target range and the range before (for example, immediately before) the conversion target range, the range before (for example, immediately before) the conversion target range may be the reference range, or another range with a correlation between the average value may be the reference range.
[0097] Also, for example, when the range before the range to be converted is used as the reference range, the encoder 10 may not transmit the parameter m, and the decoder 30 may perform encoding processing including the process of calculating the parameter m shown in FIG. 7.
[0098] 7 is a flowchart of a decoding process according to a modified example, in which the same steps as those in the decoding process shown in FIG.
[0099] In step S33, the Golomb coder / decoder 32 determines whether or not all the compression units have been processed, and if all the processing units have not been processed (step S33: N), the process proceeds to step S41.
[0100] In step S41, the Golomb coding decoding unit 32 calculates the average value μ (for example, a predetermined value if it is the first data) of the conversion target data p[t] of the reference range corresponding to the encoded data of the compression unit, and calculates a parameter m in the Golomb coding based on the average value μ.
[0101] Next, the Golomb code decoding unit 32 decodes the Golomb code for the encoded data in units of compression using the calculated parameter m, thereby obtaining the data before encoding, that is, the data to be transformed p[t] (S42).
[0102] Next, the target data calculation unit 33 converts the conversion target data p[t] into prediction difference x'[t], restores the prediction difference x'[t] to the original data sequence x[t] of each frame (S35), and proceeds to step S33.
[0103] On the other hand, if all the processing units have been processed (step S33: Y), the Golomb code decoding unit 32 advances the process to step S36.
[0104] According to the above-described decoding process, it is not necessary to transmit the parameter m from the encoder 10 to the decoder 30, and the amount of data to be transmitted can be reduced.
[0105] In the above embodiment, the voice data is divided into frames, parameters are calculated for each frame, and the parameters are Golomb-encoded, but for example, one parameter may be calculated for the entire voice data and the parameters may be Golomb-encoded. In addition, when the voice data is multi-channel voice data, parameters may be calculated for each channel or for each frame of each channel.
[0106] Also, in the above embodiment, the encoder 10 may calculate the parameter m according to the average value of the conversion target data itself, calculate the difference X between the parameter m and a parameter m' that can be calculated by the decoder 30 (for example, a parameter according to the average value of the reference region immediately before the conversion target data), transmit the calculated difference X to the decoder 30, and the decoder 30 may calculate the parameter m', add the parameter m' and the received difference X to restore the parameter m, and decode the conversion target data using this parameter m. In this way, the amount of data to be transmitted can be reduced compared to transmitting the parameter m as it is. Also, the accuracy of the parameter can be improved compared to the case where the parameter is calculated by the decoder 30 without transmitting the parameter m, and the encoding efficiency can be increased.
[0107] Also, in the above embodiment, the encoder 10 creates a file for the entire target data and transmits the file to the decoder 30. The present invention is not limited to this, and the encoder 10 may transmit compressed data for each frame sequentially.
[0108] Furthermore, in the above embodiment, the original data is encoded without distortion, but the present invention is not limited to this, and the original data may be encoded after distortion processing such as quantization.
[0109] Furthermore, in the above embodiment, the target of encoding is audio data, but the present invention is not limited to this, and the target of encoding may be data other than audio.
[0110] In the above embodiment, an example has been shown in which the computer device 100 includes either the encoder 10 or the decoder 30. The present invention is not limited to this, and the computer device 100 may include both the encoder 10 and the decoder 30. [Explanation of symbols]
[0111] 1... processing system, 10... encoder, 11... target data input unit, 12... predicted difference calculation unit, 13... Golomb code encoding unit, 14... compressed data output unit, 30... decoder, 31... compressed data input unit, 32... Golomb code decoding unit, 33... target data calculation unit, 34... target data processing unit, 50... network, 100... computer device, 101... CPU, 102... main memory, 108... output device, 111... recording medium
Claims
1. A processing device for performing processing according to a Golomb code, an average value calculation unit that calculates an average value of pre-encoded data in a predetermined reference range corresponding to a processing target range of the processing target data; and a parameter calculation unit that calculates parameters of a Golomb code for the processing range based on the average value.
2. The parameter calculation unit calculates the following equation (1): [0010] where μ is the mean value and m is a parameter. Alternatively, the parameter is calculated based on an approximation formula that can take a value similar to formula (1) for the same average value. The processing device of claim 1 .
3. the processing range is a division unit obtained by dividing the processing target data into a plurality of parts, the average value calculation unit calculates the average value corresponding to each of the division units; The parameter calculation unit calculates the parameter corresponding to the division unit. The processing device of claim 1 .
4. The predetermined reference range is the processing target range of the processing target data or a range prior to the processing target range. The processing device of claim 1 .
5. a target data receiving unit that receives compression target data; a transformation unit that transforms the compression target data into predetermined processing target data; and a Golomb coding unit that performs Golomb coding on the processing target data according to the parameters. The processing device of claim 1 .
6. the predetermined reference range is a range prior to the processing target range, a compressed data receiving unit that receives compressed data as the data to be processed; and a Golomb code decoding unit that decodes the compressed data for the processing range into a Golomb code according to the parameters. The processing device of claim 1 .
7. A processing method for a processing device that performs processing according to a Golomb code, comprising: The processing device includes: Calculating an average value of data in a predetermined reference range corresponding to a processing range of the processing target data; Calculating parameters of a Golomb code for the processing range based on the average value Processing methods.
8. A processing program for causing a computer to execute processing according to Golomb coding, The computer includes: Calculating an average value of data in a predetermined reference range corresponding to a processing range of the processing target data; Calculating parameters of a Golomb code for the processing range based on the average value Processing program.
Citation Information
Patent Citations
Device for encoding and decoding
JP2010510533A
Entropy coding and decoding schemes
JP2014502827A
Conversion apparatus, coding apparatus, decode apparatus, and method and program for them
JP2020102763A
Image encoding device, image decoding device, image encoding method, image decoding method, image encoding program, and image decoding program
JP2022127864A
Encoding method, encoding device, decoding method, decoding device, program, and recording medium
WO2010041680A1
