Method and device for pulse encoding, method and device for pulse decoding
First Claim
1. A method for pulse encoding, the method comprising:
- calculating an index value of an input pulse;
selecting a first adjustment threshold value according to the number of pulses;
comparing the index value of the pulse with the first adjustment threshold value;
if the index value is smaller than the first adjustment threshold value, adopting the first number of encoding bits to encode the index value, if the index value is not smaller than the first adjustment threshold value, adopting the second number of encoding bits to encode the index value plus an offset value, wherein the first number is smaller than the second number, the first number and the second number are both positive integers, and the offset value is greater than or equal to the first adjustment threshold value; and
wherein selecting a first adjustment threshold value according to the number of pulses comprises;
determining at least two adjustment threshold values according to the number of pulses,comparing the index value with the at least two adjustment threshold values, andif the index value is smaller than a minimum adjustment threshold value of the at least two adjustment threshold values, selecting the minimum adjustment threshold value as the first adjustment threshold value, orif the index value is greater than a maximum adjustment threshold value of the at least two adjustment threshold values, selecting the maximum adjustment threshold value as the first adjustment threshold value, orif the index value is within a range formed by two adjacent adjustment threshold values of the at least two adjustment threshold values, selecting the smaller adjustment threshold value of the two adjacent adjustment threshold values as the first adjustment threshold value.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention discloses a method and a device for pulse encoding, and a method and a device for pulse decoding. The method for pulse encoding includes: calculating an index value of an input pulse; selecting an adjustment threshold value according to the number of pulses, and comparing the index value of the pulse with the adjustment threshold value; if the index value is smaller than the adjustment threshold value, adopting the first number of encoding bits to encode the index value, if the index value is not smaller than the adjustment threshold value, adopting the second number of encoding bits to encode the index value plus an offset value, where the first number is smaller than the second number, the first number and the second number are both positive integers, and the offset value is greater than or equal to the adjustment threshold value.
-
Citations
11 Claims
-
1. A method for pulse encoding, the method comprising:
-
calculating an index value of an input pulse; selecting a first adjustment threshold value according to the number of pulses; comparing the index value of the pulse with the first adjustment threshold value; if the index value is smaller than the first adjustment threshold value, adopting the first number of encoding bits to encode the index value, if the index value is not smaller than the first adjustment threshold value, adopting the second number of encoding bits to encode the index value plus an offset value, wherein the first number is smaller than the second number, the first number and the second number are both positive integers, and the offset value is greater than or equal to the first adjustment threshold value; and wherein selecting a first adjustment threshold value according to the number of pulses comprises; determining at least two adjustment threshold values according to the number of pulses, comparing the index value with the at least two adjustment threshold values, and if the index value is smaller than a minimum adjustment threshold value of the at least two adjustment threshold values, selecting the minimum adjustment threshold value as the first adjustment threshold value, or if the index value is greater than a maximum adjustment threshold value of the at least two adjustment threshold values, selecting the maximum adjustment threshold value as the first adjustment threshold value, or if the index value is within a range formed by two adjacent adjustment threshold values of the at least two adjustment threshold values, selecting the smaller adjustment threshold value of the two adjacent adjustment threshold values as the first adjustment threshold value. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A method for pulse decoding, the method comprising:
-
demultiplexing an encoding code stream and extracting the first number of encoding bits from the demultiplexed encoding code stream; if a decoded value of the first number of encoding bits is smaller than an adjustment threshold value, outputting the decoded value of the first number of encoding bits; and if the decoded value of the first number of encoding bits is greater than or equal to the adjustment threshold value, extracting encoding bits from the code stream, wherein a sum of the number of extracted encoding bits and the first number is equal to the second number; obtaining an intermediate value by adding a reference value to the decoded value of the first number of encoding bits and then adding the decoded value of the extracted encoding bits; and obtaining the decoded value of the second number of encoding bits by subtracting an offset value from the intermediate value, wherein the offset value is greater than or equal to the adjustment threshold value, and outputting a decoded value of the second number of encoding bits, wherein the first number is smaller than the second number, and the first number and the second number are both positive integers.
-
-
8. A device for pulse encoding, the device comprising:
-
a calculating unit, configured to calculate an index value of an input pulse; a selection unit, configured to select a first adjustment threshold value according to the number of pulses; an encoding unit, configured to adopt the first number of encoding bits to encode the index value if the index value calculated and obtained by the calculating unit is smaller than the first adjustment threshold value selected by the selection unit, and adopt the second number of encoding bits to encode the index value plus an offset value if the index value calculated and obtained by the calculating unit is greater than or equal to the first adjustment threshold value selected by the selection unit, wherein the first number is smaller than the second number, the first number and the second number are both positive integers, and the offset value is greater than or equal to the first adjustment threshold value; wherein the selection unit is further configured to; determine at least two adjustment threshold values according to the number of pulses, compare the index value with the at least two adjustment threshold values, and if the index value is smaller than a minimum adjustment threshold value of the at least two adjustment threshold values, select the minimum adjustment threshold value as the first adjustment threshold value;
orif the index value is greater than a maximum adjustment threshold value of the at least two adjustment threshold values, select the maximum adjustment threshold value as the first adjustment threshold value;
orif the index value is within a range formed by two adjacent adjustment threshold values of the at least two adjustment threshold values, select the smaller adjustment threshold value of the two adjacent adjustment threshold values as the first adjustment threshold value. - View Dependent Claims (9, 10)
-
-
11. A device for pulse decoding, the device comprising:
-
an extraction unit, configured to demultiplex an encoding code stream and extract the first number of encoding bits from the demultiplexed encoding code stream, and further configured to extract encoding bits from the code stream if the decoded value of the first number of encoding bits is greater than the adjustment threshold value, wherein a sum of the number of the extracted encoding bits and the first number is equal to the second number; a decoding unit, configured to decode the first number of encoding bits, wherein the first number of encoding bits is extracted by the extraction unit, and if a decoded value of the first number of encoding bits is greater than or equal to an adjustment threshold value, decode the second number of encoding bits, wherein the second number of encoding bits is extracted from the encoding code stream, the decoding unit comprising; a calculating unit, configured to obtain an intermediate value by adding a reference value to the decoded value of the first encoding bits and then adding the decoded value of the extracted encoding bits, and an adjustment decoding unit, configured to obtain the decoded value of the second number of encoding bits by subtracting an offset value from the intermediate value, wherein the offset value is greater than or equal to the adjustment threshold value; and an output unit, configured to output the decoded value of the first number of encoding bits if the decoded value of the first number of encoding bits decoded by the decoding unit is smaller than the adjustment threshold value, and output a decoded value of the second number of encoding bits if the decoded value of the first number of encoding bits decoded by the decoding unit is not smaller than the adjustment threshold value, wherein the first number is smaller than the second number, and the first number and the second number are both positive integers.
-
Specification