CN110875744B - Coding method and device - Google Patents

Coding method and device Download PDF

Info

Publication number
CN110875744B
CN110875744B CN201811019347.5A CN201811019347A CN110875744B CN 110875744 B CN110875744 B CN 110875744B CN 201811019347 A CN201811019347 A CN 201811019347A CN 110875744 B CN110875744 B CN 110875744B
Authority
CN
China
Prior art keywords
field
coded
encoded
operation information
coding operation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811019347.5A
Other languages
Chinese (zh)
Other versions
CN110875744A (en
Inventor
刘兴奎
曹政
高山渊
王文强
虞旭林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201811019347.5A priority Critical patent/CN110875744B/en
Publication of CN110875744A publication Critical patent/CN110875744A/en
Application granted granted Critical
Publication of CN110875744B publication Critical patent/CN110875744B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/40Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
    • H03M7/4006Conversion to or from arithmetic code

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

In the technical scheme of the application, firstly, the coded section information corresponding to the coded field is determined; secondly, reading a field to be coded of preset bits from a field set to be coded; then, according to the coded section information and the read field to be coded, coding operation information is obtained, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the read field to be coded is continuously coded; and then, according to the coding operation information, coding operation is carried out on the basis of the coded field, and a new coded field obtained after the read field to be coded is continuously coded is obtained. The technical scheme realizes the encoding of the data segments to be encoded with a plurality of bits, and compared with the technology that only one bit can be encoded at a time in the prior art, the encoding efficiency is obviously improved.

Description

Coding method and device
Technical Field
The present application relates to the field of computers, and in particular, to an encoding method and apparatus, and also to an electronic device and a computer readable storage medium.
Background
Arithmetic coding is a lossless data compression method and has wide application in the fields of image compression and the like. Arithmetic coding is the direct coding of the entire input message into a fraction x satisfying 0.0.ltoreq.x < 1.0. The basic principle is to represent the message to be encoded as an interval between real numbers 0 and 1, the longer the message, the smaller the interval it is encoded to represent, and the more binary bits are needed to represent this interval.
Boolean entropy coding is a variation of arithmetic coding. In the boolean entropy coding process, only one bit can be coded at a time, and the state when one bit is coded depends on the result after the previous coding, and parallelization is difficult, which often becomes a bottleneck in data processing.
Disclosure of Invention
The application provides an encoding method, which aims to solve the technical problems that in the prior art, only one bit can be encoded at a time, parallelization is difficult and encoding efficiency is low. In addition, the application also provides a device, an electronic device and a computer readable storage medium.
The coding method provided by the application comprises the following steps:
determining coded section information corresponding to the coded field;
reading a field to be coded of preset bits from a field set to be coded;
acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the read field to be coded is continuously coded;
and performing coding operation on the basis of the coded field according to the coding operation information to obtain a new coded field after continuously coding the read field to be coded.
In some embodiments, the encoded section information corresponding to the encoded field includes:
the lower limit value of the coded section corresponding to the coded field and the section length value.
In some embodiments, the obtaining the coding operation information according to the coded section information and the read field to be coded is implemented by:
forming a triplet field by the lower limit value of the coded section and the section length value and the read field to be coded;
accessing a coding operation information table by taking the triplet field as an address to acquire a coding operation information table item corresponding to the triplet field, wherein the coding operation information table item comprises a coding operation information field used for representing coding operation information required when coding operation is executed on the basis of the coded field when the read field to be coded is continuously coded.
In some embodiments, the encoding operation information field includes:
a added value field, a shifted value field, and a shift number field.
In some embodiments, the performing the encoding operation on the encoded field according to the encoding operation information to obtain a new encoded field after continuing to encode the read field to be encoded includes:
and adding the coded field with the added value field and connecting with the previous field of the shift number in the shifted-out value field to obtain a new coded field after the read field to be coded is continuously coded.
In some embodiments, further comprising:
after obtaining a new coded field after continuously coding the read field to be coded, judging whether the new coded field reaches a preset bit number;
and outputting the new coded field if the new coded field reaches a preset number of bits.
In some embodiments, further comprising:
when the fields to be coded in the field set to be coded are coded and the corresponding new coded fields are output according to the preset bit number, judging whether new coded fields smaller than the preset bit number remain;
and if the new coded field smaller than the preset bit number remains, outputting the remaining new coded field smaller than the preset bit number according to the preset byte length.
In some embodiments, the predetermined bits of the field to be encoded are at least two bits of the field to be encoded.
The application also provides a method for generating the coding operation information table, which comprises the following steps:
determining coded section information corresponding to the coded field;
determining corresponding coding operation information in the coding process of a field to be coded of preset bits and new coded section information after coding on the basis of the coded section information, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the field to be coded is continuously coded;
establishing a mapping relation among the encoded interval information, the field to be encoded and the encoding operation information;
and storing the encoded section information, the field to be encoded and the encoding operation information with the mapping relation into an encoding operation information table.
The encoding device provided by the application comprises:
the encoded section information determining unit is used for determining encoded section information corresponding to the encoded field;
the field to be encoded reading unit is used for reading the field to be encoded with preset bits from the field set to be encoded;
the coding operation information acquisition unit is used for acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the read field to be coded is continuously coded;
and the encoding operation execution unit is used for executing encoding operation on the basis of the encoded fields according to the encoding operation information to obtain new encoded fields after the read fields to be encoded are continuously encoded.
In some embodiments, the apparatus further comprises an output unit for:
after obtaining a new coded field after continuously coding the read field to be coded, judging whether the new coded field reaches a preset bit number;
and outputting the new coded field if the new coded field reaches a preset number of bits.
The application also provides a generating device of the coding operation information table, which comprises the following steps:
the encoded section information determining unit is used for determining encoded section information corresponding to the encoded field;
the coding operation information and new coded section information determining unit is used for determining corresponding coding operation information in the process of coding a field to be coded of preset bits on the basis of the coded section information and new coded section information corresponding to the coded field, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the field to be coded is continuously coded;
the mapping relation establishing unit is used for establishing the mapping relation among the encoded interval information, the field to be encoded and the encoding operation information;
and the coding operation information table generating unit is used for storing the coded section information, the field to be coded and the coding operation information with the mapping relation into a coding operation information table.
The application also provides an electronic device comprising:
a memory and a processor;
the memory is for storing computer-executable instructions, and the processor is for executing the computer-executable instructions:
determining coded section information corresponding to the coded field;
reading a field to be coded of preset bits from a field set to be coded;
acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the read field to be coded is continuously coded;
and performing coding operation on the basis of the coded field according to the coding operation information to obtain a new coded field after continuously coding the read field to be coded.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the following operations:
determining coded section information corresponding to the coded field;
reading a field to be coded of preset bits from a field set to be coded;
acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the read field to be coded is continuously coded;
and performing coding operation on the basis of the coded field according to the coding operation information to obtain a new coded field after continuously coding the read field to be coded.
In the technical scheme of the application, firstly, the coded section information corresponding to the coded field is determined; secondly, reading a field to be coded of preset bits from a field set to be coded; then, according to the coded section information and the read field to be coded, coding operation information is obtained, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the read field to be coded is continuously coded; and then, according to the coding operation information, coding operation is carried out on the basis of the coded field, and a new coded field obtained after the read field to be coded is continuously coded is obtained. The technical scheme realizes the encoding of the data segments to be encoded with a plurality of bits, and compared with the technical scheme that only one bit can be encoded at a time in the prior art, the encoding efficiency is obviously improved.
Drawings
FIG. 1 is a process flow diagram of an embodiment of an encoding method provided herein;
fig. 2 (a) and fig. 2 (B) are schematic application scenarios of an encoding method provided in the present application;
FIG. 3 is a schematic diagram of an embodiment of an encoding apparatus provided herein;
FIG. 4 is a schematic diagram of an embodiment of an electronic device provided herein;
FIG. 5 is a process flow diagram of an embodiment of a method of generating a table of encoding operation information provided herein;
fig. 6 is a schematic diagram of an embodiment of a generating apparatus of an encoding operation information table provided in the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is, however, susceptible of embodiment in many other ways than those herein described and similar generalizations can be made by those skilled in the art without departing from the spirit of the application and the application is therefore not limited to the specific embodiments disclosed below.
The present application provides an encoding method, and fig. 1 is a process flow chart of an embodiment of the encoding method provided in the present application. The technical scheme of the encoding method provided in the present application is described below with reference to a process flow chart of an embodiment of the encoding method shown in fig. 1.
The process flow of the embodiment of the encoding method shown in fig. 1 includes:
step S101, determining encoded section information corresponding to the encoded field.
The scheme utilizes the algorithm idea of Boolean entropy coding to code the field to be coded of preset bits. It should be noted that, the existing boolean entropy coding technique encodes bit by bit, and cannot perform one-time coding for a plurality of bits. The scheme aims to realize one-time coding of a plurality of bits so as to improve coding efficiency. The step aims at determining the coded section information corresponding to the coded field, and on the basis, continuing to code the field to be coded with preset bits.
The encoded section information corresponding to the encoded field refers to information of a section generated after each encoding is completed. For example, when the previous "0101 1001" has been encoded as "0101" in the "0101 1001 0010" encoding process, the resulting "0101" is the encoded field. According to the Boolean entropy coding principle, after the coded field '0101' is obtained, a new coding section such as section [0101, 0110 ] is generated. The lower limit value "0101" of the section and the section length value "0001" are information of the section corresponding to the encoded field "0101" after the primary encoding is completed.
Step S102, reading a field to be coded of preset bits from the field set to be coded.
In step S101, it has been stated that the present solution is intended to implement one-time encoding of a plurality of bits, so in this step S102, the field to be encoded of the preset bits is at least a field to be encoded of two bits. For example, in connection with the example of step S101, it is necessary to continue encoding the following "0010" in addition to encoding the preceding "0101 1001" as "0101". This step is intended to read the following "0010" field to be encoded, see the following steps for implementations in which the field to be encoded "0010" continues to be encoded.
Step S103, according to the coded section information and the read field to be coded, coding operation information is obtained, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the read field to be coded is continuously coded.
In the example of steps S101, S102, the encoded field "0101" is obtained. The coded field "0101" corresponds to the lower limit value "0101" of the section [0101, 0110 ] and the section length value "0001" according to the boolean entropy coding principle. When the field to be encoded "0010" continues to be encoded, encoding operation information is required to be acquired, where the encoding operation information is used to characterize an encoding operation performed on the encoded field "0101" required when the read field to be encoded "0010" continues to be encoded. For example, after the previous "0101 1001" is encoded as "0101", an algorithm of addition, shift, or the like is performed on "0101", thereby continuing to encode the field "0010" to be encoded, to obtain the encoding of the entire field "0101 1001 0010".
The coding operation information is obtained according to the coded section information and the read field to be coded, and is realized by the following modes:
1) And forming a triplet field by the lower limit value of the encoded section and the section length value and the read field to be encoded. Continuing with the previous example, for example, the lower limit value "0101" of the encoded section [0101, 0110 ], the section length value "0001" and the field to be encoded "0010" are combined into a triplet field "0101 0001 0010".
2) Accessing a coding operation information table by taking the triplet field as an address to acquire a coding operation information table item corresponding to the triplet field, wherein the coding operation information table item comprises a coding operation information field used for representing coding operation information required when coding operation is executed on the basis of the coded field when the read field to be coded is continuously coded.
The coding operation information table is a set of coding operation table items, the coding operation table items are elements of the coding operation table, and the coding operation table comprises a plurality of coding operation table items, so that the coding operation table formed by combining the plurality of coding operation table items can be understood by describing the coding operation table items. The coding operation table item comprises a plurality of coding operation information fields, wherein the coding operation information fields are used for representing coding operation information which is required for executing coding operation on the coded fields when the read fields to be coded continue to be coded. The following is a specific description of an example of an entry.
Bottom Range ShiftBits AddVal ShiftOut
Table entry 1
The upper table item 1 is a schematic diagram of an encoding operation information table item. In the figure, the Bottom field in the table entry, such as "0101", represents the lower limit value of the encoded section; range represents the length value of the encoded section, e.g. "0001"; addVal represents a added value field, such as "0011"; shiftBits indicates a shift number field, such as "0010"; shiftOut indicates a shift-out value field, such as "1001". The address of the entry is the triplet field "0101 00010010" described in step 1), so that step 1) can be performed by directly using the triplet field "0101 00010010" as the address to obtain the entry 1.
In addition, the encoding operation information field in table entry 1 is represented by the value-added field "1001", the shift-out value field "1001", and the shift number field "0010" to characterize the encoding operation performed on the encoded field "0101" required when encoding is continued on the read field "0010" to be encoded, and the encoding operation performed in detail is clarified in step S104.
And step S104, performing coding operation on the basis of the coded fields according to the coding operation information to obtain new coded fields after continuing to code the read fields to be coded.
After the execution of step S103, encoding operation information is obtained, for example: the added value field "1001", the shifted-out value field "1001", and the shift number field "0010", which characterize the encoding operation performed on the encoded field "0101" required when the read field to be encoded "0010" continues to be encoded. The encoding operation may be the following:
and adding the coded field with the added value field and connecting with the previous field of the shift number in the shifted-out value field to obtain a new coded field after the read field to be coded is continuously coded. For example, the encoded field "0101" is added to the added value field "1001" to obtain "1110", and the first 2 fields "10" in the shifted-out value field "1001" are connected to obtain "111010" to obtain a new encoded field "111010" after continuing encoding the read field to be encoded "0010".
In some embodiments, further comprising:
and A), after obtaining a new coded field obtained after continuously coding the read field to be coded, judging whether the new coded field reaches a preset bit number. And B), outputting the new coded field if the new coded field reaches a preset bit number. For example, whether 64 bits are reached or not is judged. If so, a new encoded field of 64 bits is output.
In some embodiments, further comprising:
and C), judging whether a new coded field smaller than the preset bit number remains after the fields to be coded in the field set to be coded are coded and the corresponding new coded fields are output according to the preset bit number. And D), if a new coded field smaller than the preset bit number remains, outputting the remaining new coded field smaller than the preset bit number according to a preset byte length.
For example, after the encoded fields are each output in 64 bits, the remaining encoded fields are less than 64 bits and only 24 bits, and may be output in whole bytes, i.e., in byte-by-byte lengths.
The technical scheme and the technical effects that can be achieved by the present application are described in a scene by referring to the application scene diagrams of the encoding method shown in fig. 2 (a) and fig. 2 (B).
In the application scenario shown in fig. 2 (a), before encoding a field to be encoded, a limit value corresponding to the encoded field is determined in step 101. At the time of initialization, since encoding has not been performed yet, the lower limit value VarBtm corresponding to the encoded section may be set to 0, and the section length value VarRng may be set to 255. In step 102, w bits inw are read in, and a triplet address index is formed with VarBtm, varRng, and a state table is searched by the triplet address index < VarBtm, varRng, inw >, and the state table is a coding operation information table, through which a table coding operation table entry record can be obtained, and coding operation information is obtained from the table entry. After the table entry is obtained, in step 103, the added value field AddVal in the table entry is added to the encoded field StrmData and is connected with the field of the previous ShiftBits in the shift value field Shiftout, so as to obtain a new encoded field after the encoding of the field to be encoded, and meanwhile, the lower limit value of the new area generated after the new encoded field is obtained and the length value of the area are updated, so that the new encoded field to be encoded is used when the encoding of the following field to be encoded is continued after the encoding of the current field to be encoded is completed. In addition, it may also be determined in step 104 whether there is a sufficient number of bits of data in the encoded field StrmData, and if the number of bits is sufficient, step 105 may be performed, i.e., the encoded field StrmData of a sufficient number of bits is saved. It may also be determined in step 106 whether there is more input data and if so, encoding continues in the manner described above based on the encoded fields. Finally, the remaining data is processed in step 107, for example, when the remaining data does not reach a sufficient number of bits, it may be output in whole byte length.
In addition, the above steps can be understood in conjunction with fig. 2 (B). W bits in step 102 may be read from the input buffer module 201 shown in fig. 2 (B) through the data pre-reading module 202. The input w bits inw are then combined in the address generator module 203 with VarBtm and VarRng corresponding to the encoded fields to form a < VarBtm, varRng, inw > triplet field address. When executing step 103, the read record processing module 205 parses the relevant field Bottom, range, addVal, shiftbits, shiftOut from the state table module 204, first sends the fields from and Range to the address generator module (203) to generate the access address of the encoding operation information required for the next encoding, and then sends the other three fields AddVal, shiftbits, shiftOut to the data temporary storage module (206). The data temporary storage module 206 is responsible for maintaining the encoded field StrmData, implementing the processing of steps 103-107, specifically: adding the added value field AddVal generated by the record processing module (205) to the encoded field StrmData, and connecting the previous Shift bits of the entry Shift Out to the encoded field StrmData; if the encoded field has reached a sufficient number of bits (e.g., 64 bits), outputting the encoded field with the sufficient number of bits; output in whole bytes for the remaining encoded fields, etc.
In the technical scheme of the application, firstly, the coded section information corresponding to the coded field is determined; secondly, reading a field to be coded of preset bits from a field set to be coded; then, according to the coded section information and the read field to be coded, coding operation information is obtained, wherein the coding operation information is used for representing coding operation which is required to be executed on the coded field when the read field to be coded is continuously coded; and then, according to the coding operation information, coding operation is carried out on the coded field, and a new coded field obtained after the read field to be coded is continuously coded is obtained. The technical scheme realizes the encoding of the data segments to be encoded with a plurality of bits, and compared with the technical scheme that only one bit can be encoded at a time in the prior art, the encoding efficiency is obviously improved.
The coding device provided by the application is shown in fig. 3, and includes:
an encoded section information determining unit 301, configured to determine encoded section information corresponding to an encoded field;
a to-be-encoded field reading unit 302, configured to read a to-be-encoded field of a preset bit from the to-be-encoded field set;
an encoding operation information obtaining unit 303, configured to obtain encoding operation information according to the encoded section information and the read field to be encoded, where the encoding operation information is used to characterize an encoding operation performed on the basis of the read field to be encoded when encoding is continued on the read field to be encoded;
and the encoding operation execution unit 304 is configured to execute an encoding operation on the encoded field according to the encoding operation information, and obtain a new encoded field after continuing encoding the read field to be encoded.
In some embodiments, the encoded section information determining unit 301 is configured to determine a lower limit value and a section length value of an encoded section corresponding to the encoded field.
In some embodiments, the encoding operation information obtaining unit 303 is configured to:
forming a triplet field by the lower limit value of the coded section and the section length value and the read field to be coded;
accessing a coding operation information table by taking the triplet field as an address to acquire a coding operation information table item corresponding to the triplet field, wherein the coding operation information table item comprises a coding operation information field used for representing coding operation information required when coding operation is executed on the basis of the coded field when the read field to be coded is continuously coded.
In some embodiments, the encoding operation information field acquired by the encoding operation information acquisition unit 303 includes:
a added value field, a shifted value field, and a shift number field.
In some embodiments, the encoding operation execution unit 304 is configured to:
and adding the coded field with the added value field and connecting with the previous field of the shift number in the shifted-out value field to obtain a new coded field after the read field to be coded is continuously coded.
In some embodiments, the apparatus further comprises an output unit for:
after obtaining a new coded field after continuously coding the read field to be coded, judging whether the new coded field reaches a preset bit number;
and outputting the new coded field if the new coded field reaches a preset number of bits.
In some embodiments, the output unit is further configured to:
when the fields to be coded in the field set to be coded are coded and the corresponding new coded fields are output according to the preset bit number, judging whether new coded fields smaller than the preset bit number remain;
and if the new coded field smaller than the preset bit number remains, outputting the remaining new coded field smaller than the preset bit number according to the preset byte length.
The application also provides electronic equipment. Fig. 4 shows an embodiment of the electronic device. Since the embodiment of the electronic device is substantially similar to the method embodiment, the description is relatively simple, and the relevant portions are referred to the corresponding descriptions of the method embodiment provided above.
The electronic device in the embodiment shown in fig. 4 includes:
a memory 401 and a processor 402;
the memory is for storing computer-executable instructions, and the processor is for executing the computer-executable instructions:
determining coded section information corresponding to the coded field;
reading a field to be coded of preset bits from a field set to be coded;
acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the read field to be coded is continuously coded;
and performing coding operation on the basis of the coded field according to the coding operation information to obtain a new coded field after continuously coding the read field to be coded.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the following operations:
determining coded section information corresponding to the coded field;
reading a field to be coded of preset bits from a field set to be coded;
acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the read field to be coded is continuously coded;
and performing coding operation on the basis of the coded field according to the coding operation information to obtain a new coded field after continuously coding the read field to be coded.
The application also provides a method for generating the coding operation information table, which is shown in fig. 5. The technical details of this scheme can be understood in connection with the embodiments of the encoding method detailed above. The method for generating the coding operation information table comprises the following steps:
step S501, determining the encoded section information corresponding to the encoded field.
For example, a lower limit value and a section length value of an encoded section corresponding to the encoded field are determined.
Step S502, determining corresponding coding operation information in the coding process of the field to be coded of the preset bit and new coded section information after coding based on the coded section information, where the coding operation information is used to characterize a coding operation performed on the basis of the coded field when the field to be coded is continuously coded.
For example, determining a lower limit value and a section length value of a new coded section corresponding to a field to be coded of preset bits after coding; and when the field to be encoded is continuously encoded, performing operations such as addition, shift and the like on the encoded field according to the encoding operation information.
Step S503, establishing a mapping relationship among the encoded interval information, the field to be encoded and the encoding operation information.
For example, the lower limit value and the length value of the encoded section are associated with a field to be encoded and encoding operation information required for encoding the field to be encoded.
Step S504, storing the encoded section information, the field to be encoded, and the encoding operation information with the mapping relationship in an encoding operation information table.
After the coded section information, the field to be coded and the coding operation information with the mapping relation are stored in a coding operation information table, corresponding coding operation information can be queried when the multi-bit field to be coded is coded, and accordingly coding of the field to be coded is completed.
The present application also provides a device for generating a coding operation information table, see fig. 6, including:
an encoded section information determining unit 501, configured to determine encoded section information corresponding to an encoded field;
a coding operation information and new coded section information determining unit 502, configured to determine, based on the coded section information, corresponding coding operation information in a process of coding a field to be coded of a preset bit and new coded section information corresponding to the coded field, where the coding operation information is used to characterize a coding operation performed based on the coded field when continuing to code the field to be coded;
a mapping relationship establishing unit 503, configured to establish a mapping relationship among the encoded section information, the field to be encoded, and the encoding operation information;
an encoding operation information table generating unit 504, configured to store the encoded section information, the field to be encoded, and the encoding operation information with the mapping relationship into an encoding operation information table.
Corresponding to the method and apparatus shown in fig. 5 and fig. 6, the present application further provides an electronic device, including:
a memory and a processor;
the memory is for storing computer-executable instructions, and the processor is for executing the computer-executable instructions:
determining coded section information corresponding to the coded field;
determining corresponding coding operation information in the coding process of a field to be coded of preset bits and new coded section information after coding on the basis of the coded section information, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the field to be coded is continuously coded;
establishing a mapping relation among the encoded interval information, the field to be encoded and the encoding operation information;
and storing the encoded section information, the field to be encoded and the encoding operation information with the mapping relation into an encoding operation information table.
Corresponding to the method and apparatus shown in fig. 5 and 6, the present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the following operations:
determining coded section information corresponding to the coded field;
determining corresponding coding operation information in the coding process of a field to be coded of preset bits and new coded section information after coding on the basis of the coded section information, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the field to be coded is continuously coded;
establishing a mapping relation among the encoded interval information, the field to be encoded and the encoding operation information;
and storing the encoded section information, the field to be encoded and the encoding operation information with the mapping relation into an encoding operation information table.
While the preferred embodiment has been described, it is not intended to limit the invention thereto, and any person skilled in the art may make variations and modifications without departing from the spirit and scope of the present invention, so that the scope of the present invention shall be defined by the claims of the present application.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer readable media, as defined herein, does not include non-transitory computer readable media (transmission media), such as modulated data signals and carrier waves.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (11)

1. A method of encoding, comprising:
determining the encoded section information generated after the encoded field is obtained;
reading a field to be coded with preset bits from a field set to be coded, wherein the preset bits are a plurality of preset bits;
acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the read field to be coded is continuously coded;
performing coding operation on the basis of the coded field according to the coding operation information to obtain a new coded field after continuously coding the read field to be coded;
wherein the coded section information corresponding to the coded field includes: a lower limit value of an encoded section corresponding to the encoded field and a section length value;
and acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is realized by the following modes: forming a triplet field by the lower limit value of the coded section and the section length value and the read field to be coded;
accessing a coding operation information table by taking the triplet field as an address to acquire a coding operation information table item corresponding to the triplet field, wherein the coding operation information table item comprises a coding operation information field used for representing coding operation information required when coding operation is executed on the basis of the coded field when the read field to be coded is continuously coded;
the encoding operation information field includes: a added value field, a shifted value field, and a shift number field.
2. The method according to claim 1, wherein the performing an encoding operation on the encoded field according to the encoding operation information to obtain a new encoded field after continuing encoding of the read field to be encoded, comprises:
and adding the coded field with the added value field and connecting with the previous field of the shift number in the shifted-out value field to obtain a new coded field after the read field to be coded is continuously coded.
3. The method as recited in claim 1, further comprising:
after obtaining a new coded field after continuously coding the read field to be coded, judging whether the new coded field reaches a preset bit number;
and outputting the new coded field if the new coded field reaches the preset bit number.
4. A method according to claim 3, further comprising:
when the fields to be coded in the field set to be coded are coded and the corresponding new coded fields are output according to the preset digits, judging whether new coded fields smaller than the preset digits remain;
and if the new coded field with the bit number smaller than the preset bit number remains, outputting the remaining new coded field with the bit number smaller than the preset bit number according to the preset byte length.
5. The method of claim 1, wherein the predetermined bits of the field to be encoded are at least two bits of the field to be encoded.
6. A method of generating a table of encoded operation information, comprising:
determining coded section information corresponding to the coded field;
determining corresponding coding operation information in the coding process of a field to be coded of preset bits and new coded section information corresponding to the coded field on the basis of the coded section information, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the field to be coded is continuously coded, and the preset bits are a plurality of preset bits;
establishing a mapping relation among the encoded interval information, the field to be encoded and the encoding operation information;
storing the encoded section information, the field to be encoded and the encoding operation information with mapping relation into an encoding operation information table;
wherein, the determining the encoded section information corresponding to the encoded field includes: a lower limit value of an encoded section corresponding to the encoded field and a section length value;
and associating the lower limit value of the encoded section, the section length value, the field to be encoded and the encoding operation information.
7. An encoding device, comprising:
the encoded section information determining unit is used for determining encoded section information corresponding to the encoded field;
the field to be encoded reading unit is used for reading a field to be encoded with preset bits from the field set to be encoded, wherein the preset bits are a plurality of preset bits;
the coding operation information acquisition unit is used for acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the read field to be coded is continuously coded;
the encoding operation execution unit is used for executing encoding operation on the basis of the encoded fields according to the encoding operation information to obtain new encoded fields after the read fields to be encoded continue to be encoded;
wherein the coded section information corresponding to the coded field includes: a lower limit value of an encoded section corresponding to the encoded field and a section length value;
and acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is realized by the following modes: forming a triplet field by the lower limit value of the coded section and the section length value and the read field to be coded;
accessing a coding operation information table by taking the triplet field as an address to acquire a coding operation information table item corresponding to the triplet field, wherein the coding operation information table item comprises a coding operation information field used for representing coding operation information required when coding operation is executed on the basis of the coded field when the read field to be coded is continuously coded;
the encoding operation information field includes: a added value field, a shifted value field, and a shift number field.
8. The apparatus of claim 7, further comprising an output unit for:
after obtaining a new coded field after continuously coding the read field to be coded, judging whether the new coded field reaches a preset bit number;
and outputting the new coded field if the new coded field reaches a preset number of bits.
9. A coding operation information table generating apparatus, comprising:
the encoded section information determining unit is used for determining encoded section information corresponding to the encoded field;
the coding operation information and new coded section information determining unit is used for determining corresponding coding operation information in the process of coding a field to be coded of preset bits on the basis of the coded section information and new coded section information corresponding to the coded field, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the field to be coded is continuously coded, and the preset bits are a plurality of preset bits;
the mapping relation establishing unit is used for establishing the mapping relation among the encoded interval information, the field to be encoded and the encoding operation information;
the coding operation information table generating unit is used for storing the coded section information, the field to be coded and the coding operation information with mapping relation into a coding operation information table;
wherein, the determining the encoded section information corresponding to the encoded field includes: a lower limit value of an encoded section corresponding to the encoded field and a section length value;
and associating the lower limit value of the encoded section, the section length value, the field to be encoded and the encoding operation information.
10. An electronic device, comprising:
a memory and a processor;
the memory is for storing computer-executable instructions, and the processor is for executing the computer-executable instructions:
determining coded section information corresponding to the coded field;
reading a field to be coded with preset bits from a field set to be coded, wherein the preset bits are a plurality of preset bits;
acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the read field to be coded is continuously coded;
performing coding operation on the basis of the coded field according to the coding operation information to obtain a new coded field after continuously coding the read field to be coded;
wherein the coded section information corresponding to the coded field includes: a lower limit value of an encoded section corresponding to the encoded field and a section length value;
and acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is realized by the following modes: forming a triplet field by the lower limit value of the coded section and the section length value and the read field to be coded;
accessing a coding operation information table by taking the triplet field as an address to acquire a coding operation information table item corresponding to the triplet field, wherein the coding operation information table item comprises a coding operation information field used for representing coding operation information required when coding operation is executed on the basis of the coded field when the read field to be coded is continuously coded;
the encoding operation information field includes: a added value field, a shifted value field, and a shift number field.
11. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when executed by a processor, performs the following operations:
determining coded section information corresponding to the coded field;
reading a field to be coded with preset bits from a field set to be coded, wherein the preset bits are a plurality of preset bits;
acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is used for representing coding operation executed on the basis of the coded field when the read field to be coded is continuously coded;
performing coding operation on the basis of the coded field according to the coding operation information to obtain a new coded field after continuously coding the read field to be coded;
wherein the coded section information corresponding to the coded field includes: a lower limit value of an encoded section corresponding to the encoded field and a section length value;
and acquiring coding operation information according to the coded section information and the read field to be coded, wherein the coding operation information is realized by the following modes: forming a triplet field by the lower limit value of the coded section and the section length value and the read field to be coded;
accessing a coding operation information table by taking the triplet field as an address to acquire a coding operation information table item corresponding to the triplet field, wherein the coding operation information table item comprises a coding operation information field used for representing coding operation information required when coding operation is executed on the basis of the coded field when the read field to be coded is continuously coded;
the encoding operation information field includes: a added value field, a shifted value field, and a shift number field.
CN201811019347.5A 2018-08-31 2018-08-31 Coding method and device Active CN110875744B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811019347.5A CN110875744B (en) 2018-08-31 2018-08-31 Coding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811019347.5A CN110875744B (en) 2018-08-31 2018-08-31 Coding method and device

Publications (2)

Publication Number Publication Date
CN110875744A CN110875744A (en) 2020-03-10
CN110875744B true CN110875744B (en) 2023-06-20

Family

ID=69716583

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811019347.5A Active CN110875744B (en) 2018-08-31 2018-08-31 Coding method and device

Country Status (1)

Country Link
CN (1) CN110875744B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2534434A1 (en) * 1982-10-08 1984-04-13 Thomson Csf METHOD FOR ENCODING AND DECODING AN IMAGE AND DEVICES FOR IMPLEMENTING SAID METHOD
JPH11225078A (en) * 1997-09-29 1999-08-17 Canon Inf Syst Res Australia Pty Ltd Data compressing method and its device
CN103023511A (en) * 2012-12-05 2013-04-03 云之朗科技有限公司 Applied compressed encoding method and device
CN104331269A (en) * 2014-10-28 2015-02-04 中国科学院自动化研究所 Executable code compression method of embedded type system and code uncompressing system
CN104869397A (en) * 2015-05-20 2015-08-26 哈尔滨工业大学 Adaptive range coding method and decoding method based on SLWE probability
CN107113430A (en) * 2016-10-12 2017-08-29 深圳市大疆创新科技有限公司 Method, computer system and the device of Rate Control
CN108391129A (en) * 2018-04-25 2018-08-10 西安万像电子科技有限公司 Data-encoding scheme and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7528744B2 (en) * 2007-08-24 2009-05-05 Intelligent Design Systems, Inc. Data encoder system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2534434A1 (en) * 1982-10-08 1984-04-13 Thomson Csf METHOD FOR ENCODING AND DECODING AN IMAGE AND DEVICES FOR IMPLEMENTING SAID METHOD
JPH11225078A (en) * 1997-09-29 1999-08-17 Canon Inf Syst Res Australia Pty Ltd Data compressing method and its device
CN103023511A (en) * 2012-12-05 2013-04-03 云之朗科技有限公司 Applied compressed encoding method and device
CN104331269A (en) * 2014-10-28 2015-02-04 中国科学院自动化研究所 Executable code compression method of embedded type system and code uncompressing system
CN104869397A (en) * 2015-05-20 2015-08-26 哈尔滨工业大学 Adaptive range coding method and decoding method based on SLWE probability
CN107113430A (en) * 2016-10-12 2017-08-29 深圳市大疆创新科技有限公司 Method, computer system and the device of Rate Control
CN108391129A (en) * 2018-04-25 2018-08-10 西安万像电子科技有限公司 Data-encoding scheme and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邹旭洪 ; 徐志良 ; 黄成 ; .基于重归一化的CABAC编码算法的改进.工业控制计算机.2016,(05),全文. *

Also Published As

Publication number Publication date
CN110875744A (en) 2020-03-10

Similar Documents

Publication Publication Date Title
CN111027656B (en) Two-dimensional code generation and identification method and device, electronic equipment and storage medium
CA2667727C (en) Information source encoding method and decoding method, apparatuses therefor, programs therefor, and storage media which store the programs
CN108628898B (en) Method, device and equipment for data storage
BRPI1014218B1 (en) METHOD AND APPARATUS FOR PROCESSING AN IMAGE
US10489117B2 (en) Method and apparatus for generating random character string
CN110019865B (en) Mass image processing method and device, electronic equipment and storage medium
CN106849956B (en) Compression method, decompression method, device and data processing system
CN112200713A (en) Business data processing method, device and equipment in federated learning
CN113852379A (en) Data encoding method, system, equipment and computer readable storage medium
KR20180077060A (en) Method and apparatus for encoding and decoding lists of pixels
CN111813840B (en) Data processing method, equipment and storage medium
US20160092492A1 (en) Sharing initial dictionaries and huffman trees between multiple compressed blocks in lz-based compression algorithms
US6313767B1 (en) Decoding apparatus and method
CN108053034B (en) Model parameter processing method and device, electronic equipment and storage medium
CN110875744B (en) Coding method and device
CN110730277B (en) Information coding and method and device for acquiring coded information
CN108062289B (en) Fast Fourier Transform (FFT) address order changing method, signal processing method and device
US20220005229A1 (en) Point cloud attribute encoding method and device, and point cloud attribute decoding method and devcie
US8854235B1 (en) Decompression circuit and associated compression method and decompression method
Vural et al. Reversible video watermarking through recursive histogram modification
US8331693B2 (en) Information encoding apparatus and method, information retrieval apparatus and method, information retrieval system and method, and program
US20240080478A1 (en) Point cloud encoding and decoding method and apparatus, computer, and storage medium
CN109005413B (en) Probability estimation method and device in arithmetic coding and electronic equipment
CN112686966B (en) Lossless image compression method and device
WO2019191904A1 (en) Data processing method and device

Legal Events

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