Method and apparatus for processing equally probable symbols in entropy coding

By constructing a data unit structure, the entropy encoded symbols and bypass encoded symbols are arranged in the forward and reverse order, which solves the problem of low processing efficiency of medium probability symbols in the prior art, realizes parallel decoding of no signaling length fields, and improves data compression efficiency and system performance.

CN113574805BActive Publication Date: 2025-08-26BLACKBERRY LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202080022464.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-03-18
Filing Date
2020-03-12
Publication Date
2025-08-26
Estimated Expiration
2040-03-12

AI Technical Summary

Technical Problem

The existing entropy encoding system is difficult to effectively process equal probability symbols, resulting in a reduced compression efficiency. Especially when processing ordinary symbols and equal probability symbols at the same time, the existing methods require additional signaling overhead and decoder buffering streams with unknown lengths, affecting system performance.

Method used

By using parallel decoding technology, by constructing a data unit structure, entropy encoded symbols and bypass encoded symbols are arranged in the forward and reverse order respectively, and there is no need for signaling length fields in the data unit. The decoder decodes at the beginning and end of the data unit by initializing the pointer, thereby realizing parallel decoding without understanding the flow length.

Benefits of technology

Improve data compression efficiency, reduce signaling overhead, simplify the decoding process, and improve the overall performance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113574805B_ABST
    Figure CN113574805B_ABST
Patent Text Reader

Abstract

A method for encoding and decoding data in which some data symbols are entropy coded and some data symbols are bypass coded. The encoder separates the coded symbols into an entropy coded stream and a bypass coded stream. These streams are encapsulated in a data unit having a payload structured to contain a forward sequential stream and another reverse sequential stream, wherein the reverse sequential stream is aligned with the end of the data unit. In this way, at the decoder, the decoder can start decoding the forward sequential stream from the beginning of the forward sequential stream and can also decode the reverse sequential stream from the beginning of the reverse sequential stream at the end of the data unit by extracting symbols in reverse order. The data unit does not need to signal the length of the stream. The decoder determines the length of the data unit from explicit or implicit signaling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application generally relates to data compression and, in one particular example, to entropy coding of symbols. The present application describes methods and apparatus for processing equally probable symbols in an entropy coding system. Background Art

[0002] Data compression is used in communications and computer networks to efficiently store, transmit, and reproduce information. Data is typically in the form of symbols drawn from an alphabet. In some examples, the alphabet may be binary, but in many other examples, the alphabet may be non-binary.

[0003] Entropy coding is often used to encode a series or sequence of symbols so that the bits needed to represent the series or sequence are reduced to fewer bits than would be required for entropy coding. In some cases, entropy coding can be context-adaptive entropy coding. Example entropy coding processes include variable length codes, such as Huffman codes, arithmetic coding, and the like.

[0004] An alphabet consisting of equally probable symbols cannot be compressed. Therefore, it is undesirable to use an arithmetic encoder or other complex entropy encoder to convey equally probable symbols. However, for system design reasons, it is often desirable to interleave both common symbols and equally probable symbols when using a single entropy encoder.

[0005] It would be advantageous to provide an encoder and decoder that can efficiently process entropy coded symbols and equally probable symbols. BRIEF DESCRIPTION OF THE DRAWINGS

[0006] Reference will now be made, by way of example, to the accompanying drawings which show example embodiments of the present application, and in which:

[0007] Figure 1 An example of an entropy encoder using both entropy encoding and bypass encoding is shown;

[0008] Figure 2 schematically illustrates the structure of an example data unit;

[0009] Figure 3 An example of an encoder is shown in block diagram form;

[0010] Figure 4 An example of a decoder is shown in block diagram form;

[0011] Figure 5 An example encoding process is shown in the form of a flow chart;

[0012] Figure 6 An example decoding process is shown in flowchart form;

[0013] Figure 7 schematically illustrates the structure of another example data unit;

[0014] Figure 8 A simplified block diagram illustrating an example embodiment of an encoder; and

[0015] Figure 9 A simplified block diagram of an example embodiment of a decoder is shown.

[0016] The same reference numerals may be used in different drawings to identify the same components. DETAILED DESCRIPTION

[0017] The present application describes methods and apparatus for encoding and decoding entropy-coded data together with bypass-coded data, where the bypass-coded data may include non-entropy coding of equally probable symbols. The method and apparatus may include encapsulating streams of the entropy-coded and bypass-coded data together in a payload, thereby avoiding the cost of having to signal the lengths of the individual streams.

[0018] In one aspect, the present application describes a method for decoding a data unit to reconstruct encoded data. The method may include: receiving a data unit, the data unit including, in sequence, a preamble, a payload, the payload including, in sequence, a forward sequence bit stream, and a reverse sequence bit stream; determining a length of the data unit; selectively reading data from the forward bit stream in forward sequence or reading data from the reverse bit stream in reverse sequence in response to a request for symbols from a decoding unit; and decoding the data in the decoding unit to reconstruct the symbols. One of the forward sequence bit stream and the reverse sequence bit stream includes entropy coded symbols, and the other of the forward sequence bit stream and the reverse sequence bit stream includes bypass coded symbols.

[0019] In another aspect, the present application describes a method for transmitting encoded data, wherein the encoded data includes a first bit stream of entropy coded symbols and a second bit stream of bypass coded symbols. The method may include buffering the first bit stream and the second bit stream; reversing one of the first bit stream and the second bit stream to create a reverse sequence bit stream, wherein the other of the first bit stream and the second bit stream is a forward sequence bit stream; generating a data unit, the data unit including, in sequence, a preamble, a forward sequence bit stream, and a reverse sequence bit stream; and outputting the data unit.

[0020] In another aspect, the present application describes encoders and decoders configured to implement such encoding and decoding methods.

[0021] In yet another aspect, the present application describes a non-transitory computer-readable medium storing computer-executable program instructions that, when executed, cause one or more processors to perform the described encoding and / or decoding methods.

[0022] In yet another aspect, the present application describes a computer-readable signal containing program instructions that, when executed by a computer, cause the computer to perform the described encoding and / or decoding methods.

[0023] Those skilled in the art will understand other aspects and features of the present application by reading the following example description in conjunction with the accompanying drawings.

[0024] Any feature described in relation to one aspect or embodiment of the invention may also be used in one or more other aspects / embodiments.These and other aspects of the invention will be apparent from and elucidated with reference to the embodiments described herein.

[0025] In this application, the term "and / or" is intended to cover all possible combinations and subcombinations of the listed elements, including any one of the elements listed individually, any subcombination of elements, or all the elements, and does not necessarily exclude additional elements.

[0026] In this application, the phrase "at least one of... or..." is intended to encompass any one or more of the listed elements, including any one of the listed elements individually, any subcombination of elements, or all elements, and does not necessarily exclude any additional elements, nor does it necessarily require all elements.

[0027] First reference Figure 1 , Figure 1 A block diagram of an example encoder 100 is shown. Encoder 100 includes an encoding unit 102 that converts source data into a bitstream of encoded symbols. The source data may include any data that is compressed according to a compression scheme. Non-limiting examples include image data, audio data, video data, point cloud data, and other types of data. The bitstream output from encoding unit 102 may include some symbols encoded using entropy coding and some symbols that have been bypass encoded.

[0028] The payload encapsulator 104 receives a bitstream and encapsulates the bitstream for storage or transmission. In some cases, this includes breaking the bitstream into multiple parts and grouping the parts so that each data unit includes a preamble and a payload having a portion of the bitstream. The data unit is then output for storage or transmission.

[0029] In some cases, entropy coders such as arithmetic coders can be adapted to handle symbols of equal probability. For example, in a binary arithmetic coder, the subdivision of intervals can be simplified (such as implementing multiplication as bit shifts). However, calculations are still required to update the codec state and determine the decoded symbol values ​​(at the decoder). This optimization can be used in the design of compression systems by specifying that certain symbols use a static p=0.5 probability model, where the specified symbols are called bypass coding. Both H.264|AVC and H.265|HEVC video compression systems use this approach.

[0030] In an alternative implementation, the symbol stream can be divided into two sub-streams. The first stream consists of arithmetically coded non-bypass coded symbols, resulting in a so-called Arithmetic Entropy Coded (AEC) stream, and the second stream is an uncompressed sequence of bypass coded symbols. In order to encapsulate and transmit the two separate streams, a length field is used to indicate the length L of the first coded sub-stream, which then allows the decoder to access both streams simultaneously, which it needs to do in order to re-multiplex the symbols in the correct sequence during decoding. Due to the additional signaling of the length field, this approach results in reduced compression efficiency and also requires the decoder to buffer the entire length L of the first sub-stream in order to access the start of the second sub-stream (at position L+1).

[0031] In one aspect, the present application provides a method for encoding symbols that can decode an entropy coded stream and a bypass coded stream in parallel without the signaling overhead of a length field. In a system in which coded data is signaled in a data unit whose length can be determined by a decoder, the payload of the data unit is constructed to include one stream in forward order and another stream in reverse order, wherein the reverse order stream is aligned with the end of the data unit. In this way, at the decoder, the decoder can decode the forward order stream from the beginning of the forward order stream, which is at the front of the data unit, after the preamble or other metadata structure, and can also decode the reverse order stream from the beginning of the reverse order stream at the end of the data unit by extracting symbols in reverse order. Clearly, the decoder does not need to know the length of either stream to begin decoding it. It should also be understood that the decoder will need to buffer the entire data unit in a memory to be able to consume the data unit from both ends.

[0032] In one example, the reverse sequence pointer may start at the end of the data unit and decrement as encoding symbols are read from the reverse sequence stream. In another example, the data units may be copied to memory in reverse order, and the reverse stream pointer aligned with the start of the reverse data unit may then be incremented to sequentially read encoding symbols of the reverse sequence stream.

[0033] Figure 2An example data unit 200 is schematically illustrated. The data unit 200 is constructed to include a preamble 202 at its beginning. The preamble 202 contains header information, which in various embodiments may include metadata such as, for example, a version code, various types of signaling flags (e.g., parameters used by the decoding or reconstruction process), a timestamp, a data type code, etc. It should be understood that the preamble can have a length fixed by the protocol, a fixed length signaled elsewhere in the bitstream, or a variable length determined by the decoder, such as by detecting an end code. In some implementations, the preamble 202 can signal the data unit length. This can include an explicit length field, or the length can be specified by a data unit type code or other metadata linked to a length value.

[0034] In transmission order, the preamble 202 is followed by the payload 204. The front end of the payload 204 includes a forward sequence stream 206. The forward sequence stream 206 is aligned with the start of the payload 204. The payload 204 also includes a reverse sequence stream 208. The reverse sequence stream 208 is a bit stream that has been reversed and added to the payload 204 to align the original start of the bit stream before the reversal with the end of the data unit 200.

[0035] In one example, the forward sequential stream 206 contains entropy coded symbols and the reverse sequential stream 208 contains bypass coded symbols. In another example, the forward sequential stream 206 contains bypass coded symbols and the reverse sequential stream 208 contains entropy coded symbols.

[0036] At the decoder, after reading the preamble 202, the decoder may initialize two pointers: a forward read pointer initialized to the beginning of the forward sequential stream 206, and a reverse read pointer initialized to the end of the data unit 200 (i.e., the beginning of the reverse sequential stream 208). As will be appreciated by those skilled in the art, the concept of initializing the reverse read pointer at the end of the data unit may mean that it is initialized to the location of the beginning of a byte, word, or other data unit, where the end of the byte, word, or other data unit is aligned with the end of the data unit 200, and also means that the pointer does not necessarily point to the last bit of the data unit 200.

[0037] When symbols are requested for decoding and reconstruction of data, the decoder reads the encoded symbol(s) from either the forward sequential stream 206 or the reverse sequential stream 208, depending on the type of symbol requested. As symbols are read from the reverse sequential stream 208, the reverse read pointer is decremented.

[0038] It should be understood that the reverse sequential bit stream 208 can be generated by bit-by-bit reversal of the original bit stream. In some cases, particularly where the memory is byte-addressed, the reverse sequential bit stream 208 can be generated by byte-by-byte reversal of the original bit stream. Similarly, depending on the size of the encoded data extracted with each symbol read operation, the incrementing of the forward read pointer or the decrementing of the reverse read pointer may correspond to a bit-by-bit change in the memory location pointed to, a byte-by-byte change in the memory location pointed to, etc. Other granularities may also be used, including word, half-word, or other granularities.

[0039] Using the above technology, if the decoder knows or can determine the length of the data unit 200, there is no need to signal the length of the stream to the decoder. In one example, the length of the data unit is specified as a higher level in the protocol stack. Examples include network datagram payload length, file format, application programming interface (API) definition or other high-level specifications. In another example, the preamble 202 itself is constructed to include a signal indicating the length of the data unit. For example, the length can be explicitly specified in the preamble 202. Alternatively, for example, a code or other index can indicate the data unit type associated with a specific data unit length. In another example, the preamble 202 can include a synchronization code word that signals the start of the data unit to the decoder. By finding the next synchronization code word in the transmitted bit stream, the decoder can determine the length of the data unit 200.

[0040] Now refer to Figure 3 , Figure 3 An example encoder 300 is illustrated in block diagram form. The encoder 300 includes an encoding unit 302 that generates two streams: an entropy-coded stream 304 and a bypass-coded stream 306. In some examples, the encoding unit 302 generates a single bitstream in which the entropy-coded and bypass-coded data are interleaved. In such embodiments, the encoding unit 302 also includes a demultiplexer to separate the stream into the two streams 304, 306 based on symbol type.

[0041] As used herein, the term "symbol type" refers to whether a symbol is entropy coded or bypass coded. The symbol type may be specified by a context model that specifies a particular coding mechanism for a particular symbol. For example, in the example case of video coding of transform domain coefficients, the context model may specify certain context determination operations to determine the context for entropy coding of significant coefficient flags, flags greater than one, and the like. It may further specify that certain symbols (such as the sign bit) are to be bypass coded, i.e., the probability of such symbols is statically set to p = 0.5. In some examples, as will be further described below, symbols that are designated as entropy coded in a context adaptive system may happen to have probabilities that are close enough to equiprobability (p = 0.5) that they are rerouted to the bypass encoder instead of being entropy coded.

[0042] The encoder 300 further includes a buffer 308 to store the entropy coded stream 304 and the bypass coded stream 306. The buffer 308 may include one or more physical memories and / or portions of physical memories.

[0043] In some embodiments, buffer 308 may store one of streams 304, 306 in reverse order. That is, the store operation may include applying a reversal of the data order to one of streams 304, 306. As described above, the reversal may be bit-by-bit, byte-by-byte, or some other level.

[0044] The encoder 300 also includes a payload encapsulator 310. The payload encapsulator 310 may be part of a data transmission unit configured to packetize and encapsulate data for transmission according to a selected transmission protocol. The payload encapsulator 310 outputs the encapsulated data in the form of a data unit 312. The data unit 312 is structured as follows: Figure 2 That is, it starts with a preamble, followed by a forward sequence stream, and ends with a reverse sequence stream. In this example, the forward sequence stream may include an entropy coded stream 304, and the reverse sequence stream may include a reverse copy of a bypass coded stream 306.

[0045] If the buffer 308 is configured to store the bypass coded stream 306 in reverse order, the reverse order stream may be obtained by the payload encapsulator 310 by reading the reverse stored bypass coded stream 306 from the buffer 308. If the buffer 308 stores the bypass coded stream 306 in its forward coding order, the payload encapsulator 310 may reverse the bypass coded stream 306 before inserting it into the data unit 312. In one example, this may include reading the bypass coded stream 306 from the buffer 308 in reverse order.

[0046] It should also be understood that the reverse sequence stream will be aligned with the end of data unit 312. If data unit 312 has a specified or fixed length, payload encapsulator 310 can add buffer bits and / or bytes to ensure that the first byte of bypass coded stream 306 (in coding order) is located in the last byte position of data unit 312. Even if the data unit is not of a specified length, payload encapsulator 310 can be configured to add bits to the end of entropy coded stream 304 and bypass coded stream 306 (in coding order) to ensure that they are byte-aligned when processed on a byte-by-byte basis. These padding bits can be discarded by the decoder when it determines that decoding of streams 304 and 306 is complete. It will be understood that the decoder, through the operation of the decoding process, consumes symbols according to the context-adaptive decoding process being used and can therefore determine when it has reached the end of a coded portion (e.g., the portion of data being reconstructed as specified by the coding scheme).

[0047] In some cases, buffer 308 may include more than one buffer / memory. Because the lengths of the two streams are typically unknown in advance when encoding unit 302 generates two streams, two buffers are used with subsequent concatenation operations, or a single sufficiently large buffer is used and concatenation is performed by shifting the data within the buffer. For example, the bypass coded stream can be shifted to align with the end of the entropy coded stream; alternatively, the preamble and forward entropy coded stream can be shifted to align with the beginning of the reverse bypass coded stream.

[0048] In some implementations, payload encapsulator 310 can have its own output buffer to which it writes data to assemble data unit 312. In some implementations, payload encapsulator 310 uses buffer 308 to assemble data unit 312 using, for example, the concatenate / reverse operations discussed above.

[0049] Now refer to Figure 4 , Figure 4 An example decoder 400 is shown in block diagram form. The decoder 400 receives one or more data units constructed according to the above description. The decoder 400 includes a payload decapsulator 402 that receives the data units. Depending on the transport protocol, the payload decapsulator 402 may, in some cases, extract the data units from other encapsulations. The payload decapsulator 402 may store the data units, or at least the payload, in a buffer 404. In some cases, the payload decapsulator 402 writes a copy of the data unit to the buffer 404 in forward (transmission) order. In one example, the payload decapsulator 402 writes a second copy of the data unit to the buffer 404, but in reverse order (bit by bit, byte by byte, or otherwise), such that the start of the reverse stored data unit is aligned with the start of the (reverse) bypass coded stream, which is aligned with the end of the payload.

[0050] In this example, it is assumed that the payload decapsulator 402 writes a single copy of the data unit to the buffer 404. As previously described, the data unit includes a preamble 406, a forward sequence stream 408, and a reverse sequence stream 410.

[0051] In some examples, decoder 400 may initialize a forward read pointer 412 at the first bit / byte of forward sequential stream 408 and a reverse read pointer 414 at the first bit / byte / etc. of reverse sequential stream 410. A decoding unit 416 manages the decoding and reconstruction process based on the encoding model of the data in question. As the decoding process progresses, decoding unit 416 requests 418 the next encoded symbol based on the decoding process and the context model being used. Request 418 may indicate the symbol type, i.e., entropy coding or bypass coding. A read operation then occurs to read a portion of data, such as encoded symbol(s), from a stored data unit from forward sequential stream 408 or reverse sequential stream 410, depending on the symbol type in request 418. The read operation extracts the encoded symbol(s) from the address indicated by forward read pointer 412 or reverse read pointer 414, depending on the requested symbol type. The forward read pointer 412 or reverse read pointer 414 is then incremented or decremented, respectively.

[0052] In the example where the entropy coded stream is an arithmetic coded bitstream, i.e., an AEC stream, it should be understood that the AEC decoder operates somewhat asynchronously, since a portion of the bits from the bitstream do not correspond to discrete symbols, but rather a portion of the bits from the bitstream define an arithmetic encoding of a continuous interval, where the continuous interval reflects the encoding of a binary code sequence based on contextual probabilities. In this sense, the AEC decoder can consume a sequence of bits from the bitstream as it decodes a series of arithmetic coded binary codes (symbols), and then make the decoding unit 416 available in response to a request for a symbol 418. In such an embodiment, the "incrementation" of the pointer is associated with the consumption of bits from the bitstream by the AEC decoder, rather than the output of decoded symbols by the AEC decoder.

[0053] Figure 5 , a flowchart illustrating an example encoding process 500 is shown in FIG. The encoding process 500 assumes that an entropy coded stream and a bypass coded stream are being generated and, if applicable, demultiplexed from an integrated stream. The process 500 begins by buffering at least a portion of the entropy coded stream and the bypass coded stream as they are generated in operation 502. In this example, the bypass coded stream is reversed in operation 504. As described above, in some cases, this reversal may occur while the bypass coded stream is being stored in the buffer in operation 502. In some cases, this reversal may occur after storage. In some cases, the reversal operation 504 occurs by reading the bypass coded stream in reverse order and rewriting it to the buffer. In some cases, the reversal operation 504 occurs when the payload is generated by reading the bypass coded stream from the buffer in reverse order.

[0054] In operation 506, the encoder generates a data unit, wherein the data unit sequentially includes a preamble, a forward sequence stream, and a reverse sequence bypass coded stream. According to the coding order, the beginning of the bypass coded stream is aligned with the end of the data unit.

[0055] The data unit is then output in operation 508 .

[0056] The example decoding process 600 is performed by Figure 6 . The decoding process 600 includes: in operation 602, receiving a data unit having the above structure. That is, the data unit includes a preamble and a payload. The payload includes an entropy coded stream and a bypass coded stream. One of the streams is in forward order and appears in the data unit, immediately following the preamble, and the other stream is in reverse order and aligned with the end of the data unit. Data, such as bit stuffing or other data, may or may not exist between the two streams in the payload. For the purposes of this example, the bypass coded stream is assumed to be a reverse order stream.

[0057] The decoder determines the length of the data unit in operation 604. As described above, the length of the data unit can be specified by the transmission type, the encoding protocol, higher-level header information, or some other external source. In some cases, the length of the data unit can be explicitly or implicitly specified in the preamble. In some cases, the length of the data unit can be signaled by a synchronization codeword in each preamble, so that the decoder determines the length of the data unit by finding the next synchronization codeword in the incoming data bit stream.

[0058] The data unit is stored in a memory of the decoder. In operation 606, the decoder initializes a first read pointer at the beginning of the entropy coded stream and a second read pointer at the beginning of the bypass coded stream in coding order (i.e., at the end of the data unit). In operation 608, a request for coded symbols is generated. The request is driven by a decoding process that decodes and reconstructs symbols from the data unit as part of the decoding and data reconstruction process. Example processes include audio coding, video coding, multimedia coding, point cloud coding, or other data compression processes.

[0059] In operation 610, the symbol type associated with the request is determined. That is, whether the request is for a bypass-coded symbol or an entropy-coded symbol. If the requested symbol is entropy-coded, then in operation 612, data is read from the forward sequential stream, i.e., the portion of the entropy-coded stream pointed to by the first read pointer. Then, in operation 614, the first read pointer is incremented. Conversely, if the requested symbol is bypass-coded, then in operation 616, data is read from the reverse sequential stream, i.e., the portion of the bypass-coded stream pointed to by the second read pointer. Then, in operation 618, the second read pointer is decremented. Depending on the situation, the decoder passes the extracted coded symbol to either the entropy decoder or the bypass decoder.

[0060] It should be understood that in some embodiments, the decoder may store a second copy of the data unit in a memory in reverse order. In this case, the second read pointer is initialized to point to the beginning of the reverse order data unit, and the second read pointer is incremented as the bypass coded symbols are read.

[0061] In operation 620, the decoder evaluates whether it has completed decoding the bypass coded stream and the entropy coded stream. If not, it returns to operation 608 to evaluate the next symbol request. If yes, it moves to the next data unit in operation 602.

[0062] It should be understood that it is impossible to determine the end of a stream without decoding its entirety. Therefore, the operation of an entropy decoder (e.g., an arithmetic decoder) does not rely on bounded bitstream reading to discard trailing bits in the stream. A bounded read operation is one that returns a predefined constant value after reading a predefined number of bits. In other words, an entropy coded stream must be completely self-contained.

[0063] As mentioned above, byte-by-byte addressing is common in many systems, which may result in byte-by-byte processing of encoded data, including byte-by-byte reversal of one of the encoded streams. To avoid pointer dereferences after each extraction of eight bypass symbols, some systems may copy the current substream byte into an intermediate variable. This can be facilitated by properly ordering the constituent bits of each byte of the reversed bypass substream, improving efficiency by using multi-byte intermediate variables.

[0064] To enable multi-byte operations in the case of architectures using a little-endian data model, the bits in each byte can be ordered so that the most significant bit in a given byte is the first bit to be decapsulated in that byte, and the least significant bit in a given byte is the last bit to be decapsulated in that byte. For a bit sequence a...x, where bit a is the first bit to be decoded and x is the last bit, the resulting substream structure can be illustrated as follows:

[0065]

[0066]

[0067] On a little-endian architecture, reading the 3-byte word at address N-3 produces the binary word abcdefghijklmnopqrstuvwx b This property is extendible to any machine word size. The variable L can be used to keep track of the current bit-level read (or write) position of the current word.

[0068] One way to extract a single bit V from a Q-bit sized word W is to keep the MSB of W as the next unread bit:

[0069] 1.if(L==0){ ;If there are no available bits

[0070] 2.W = *data_ptr--; load the next Qbit word and advance the pointer

[0071] 3.L=Q; reset the read position

[0072] }

[0073] 4. V = (W>>(Q-1)) & 1; extract the MSB of W as V

[0074] 5.L=L-1; move forward to read position

[0075] Now refer to Figure 7 , Figure 7 The structure of another example data unit 700 is schematically shown. In this example, as described above, the data unit 700 includes a preamble 702 and a payload 704, and the payload 704 includes a forward sequence stream 706 and a reverse sequence stream 708. However, between the forward sequence stream 706 and the reverse sequence stream 708, the payload 704 includes additional data 710. Advantageously, when the decoder decodes the two streams 706 and 708, it discovers their respective lengths and can then extract the data 710 stored between them.

[0076] An example use of additional data 710 is undecoded filler data. When a data unit is parsed according to a given syntax or grammar, no attempt is made to interpret the additional data. The encoder can use this property to simplify flushing operations (potentially flushing more data than necessary), or use additional data 710 to insert hidden markers that can be used to identify the bitstream, or alternatively, use filler data to meet minimum bitrate requirements.

[0077] In another example implementation, additional data 710 can be substantial. In one example, if after streams 706 and 708 are decoded, the two bitstream pointers forming the decoder state do not point to adjacent bytes, then additional data 710 exists and is parsed by the decoder. Additional data 710 can be transmitted in forward or reverse order. The exact selection of order can be relevant to the expected use of the surrounding streams 706 and 708. For example, if it is known that one stream terminates before the other, the order of the stream can be used. In some configurations, the order can depend on whether the reverse order provides more efficient stream access for the decoder.

[0078] Additional data 710 may be entropy coded data, bypass coded data, or other data. In one example, data 710 is another pair of forward and reverse sequence bit streams, such that data unit 700 includes a recursively nested pair of entropy coded streams and bypass coded streams. Additional data 710 may or may not include an additional preamble.

[0079] To parse any additional data 710 that may be present, in one embodiment, the decoder read pointer is advanced to skip over any bits inserted into the corresponding stream for flushing or byte alignment purposes, effectively discarding any partial bits from the decoder buffer. An alternative embodiment may omit the flushing or byte alignment of the first corresponding stream, and instead require byte alignment and flushing of subsequent streams (although reinitialization of subsequent AEC streams may still need to occur). In such a system, if the data unit 700 does not contain additional data 710, the encoder will flush the stream or byte align the stream.

[0080] The preamble may include a flag that signals whether additional data 710 is present in the bitstream. In some implementations, the flag may indicate formal restrictions on the bitstream construction to ensure that no filler data is present. For example, after all parseable data in a data unit has been parsed, the decoder confirms that the two bitstream pointers that form the decoder state point to adjacent bytes. Unless a flag is signaled earlier in the bitstream (e.g., in the preamble) to indicate the presence of additional data 710, the two bitstreams must point to adjacent bytes or an error is detected.

[0081] In many of the examples above, the entropy encoder generates an entropy-coded stream and a bypass-coded stream based on the symbol type specified by the coding model. That is, the coding process may dictate whether a particular symbol is to be context-adaptively entropy coded, or whether the symbol has a static probability of p = 0.5 and is bypass-coded in all cases, possibly due to the symbol type. However, in some context-adaptive coding processes, context evolution may occur, depending on the statistics of the underlying data, such that the associated probability approaches p = 0.5. In such cases, it may be beneficial to force such symbols to be assigned to the bypass encoder rather than using the entropy encoder, despite the fact that they should be entropy coded according to the context model.

[0082] For a symbol with an associated adaptive probability model, an example process may include:

[0083] The current symbol probability prob0 is checked and the difference between it and the equally probable probability (eg, 0.5 for binary symbols) is tested against a threshold. For example, an example threshold may be less than 0.05 or less than 0.03.

[0084] If the difference is less than the threshold, the symbol is processed as a normal bypass symbol. Otherwise, it is processed by an entropy encoder (such as an arithmetic codec). In both cases, the symbol probability model (i.e., the next value of prob0) is updated based on the symbol value, the current symbol probability, and the usual update function in context-adaptive coding schemes.

[0085] Now refer to Figure 8 , Figure 8 A simplified block diagram of an example embodiment of an encoder 800 is shown. The encoder 800 includes a processor 802, a memory 804, and an encoding application 806. The encoding application 806 may include a computer program or application stored in the memory 804 and containing instructions that, when executed, cause the processor 802 to perform operations such as those described herein. For example, the encoding application 806 may encode and output data units according to the processes described herein. It should be understood that the encoding application 806 may be stored on a non-transitory computer-readable medium (such as an optical disc, a flash memory device, a random access memory, a hard disk drive, etc.). When the instructions are executed, the processor 802 performs the operations and functions specified in the instructions to operate as a dedicated processor that implements the described process(es). In some examples, such a processor may be referred to as a "processor circuit" or "processor circuit system."

[0086] Now also refer to Figure 9 , Figure 9A simplified block diagram of an example embodiment of a decoder 900 is shown. The decoder 900 includes a processor 902, a memory 904, and a decoding application 906. The decoding application 906 may include a computer program or application stored in the memory 904 and containing instructions that, when executed, cause the processor 902 to perform operations such as those described herein. It should be understood that the decoding application 906 may be stored on a computer-readable medium (such as an optical disc, a flash memory device, a random access memory, a hard drive, etc.). When the instructions are executed, the processor 902 performs the operations and functions specified in the instructions to operate as a dedicated processor that implements the described process(es). In some examples, such a processor may be referred to as a "processor circuit" or "processor circuitry."

[0087] It should be understood that the decoder and / or encoder according to the present application can be implemented in a number of computing devices, including but not limited to servers, appropriately programmed general-purpose computers, machine vision systems, and mobile devices. The decoder or encoder can be implemented by software containing instructions that configure one or more processors to perform the functions described herein. The software instructions can be stored on any suitable non-transitory computer-readable memory (including CD, RAM, ROM, flash memory, etc.).

[0088] It should be understood that the decoders and / or encoders described herein and the modules, routines, processes, threads, or other software components that implement the described methods / processes for configuring the encoders or decoders can be implemented using standard computer programming techniques and languages. The present application is not limited to specific processors, computer languages, computer programming conventions, data structures, or other such implementation details. Those skilled in the art will recognize that the described processes can be implemented as part of a computer executable code stored in volatile or non-volatile memory, as part of an application specific integrated circuit (ASIC), or the like.

[0089] The present application also provides a computer-readable signal encoding data produced by applying the encoding process according to the present application.

[0090] Certain adaptations and modifications may be made to the described embodiments.Therefore, the embodiments discussed above are considered to be illustrative rather than restrictive.

Claims

1. A method for decoding a data unit to reconstruct encoded data, the method comprising: receiving the data unit, wherein the data unit sequentially includes a preamble and a payload, wherein the payload sequentially includes a forward sequence bit stream and a reverse sequence bit stream; determining the length of the data unit; selectively reading data from the forward sequence bit stream in the forward sequence or reading data from the reverse sequence bit stream in reverse sequence in response to a request for a symbol from a decoding unit; and decoding the data in the decoding unit to reconstruct the symbols, One of the forward sequence bit stream and the reverse sequence bit stream includes entropy coded symbols, and the other of the forward sequence bit stream and the reverse sequence bit stream includes bypassed non-entropy coded symbols.

2. The method of claim 1 , wherein the request for a symbol indicates whether the symbol type is entropy coded or bypass non-entropy coded, and wherein selectively reading data of the forward sequential bit stream or the reverse sequential bit stream is based on the symbol type.

3. The method according to claim 1 or 2, wherein the method further comprises: A forward read pointer is initialized at the beginning of the forward sequential bit stream after the preamble, and a reverse read pointer is initialized at the end of the data unit.

4. The method of claim 3 , wherein reading data from the forward sequential bit stream comprises reading the data indicated by the forward read pointer and then incrementing the forward read pointer, and wherein reading data from the reverse sequential bit stream comprises reading the data indicated by the reverse read pointer and then decrementing the reverse read pointer. 5 . The method of claim 4 , wherein the data has a size of one or more bytes, and wherein the forward read pointer or the reverse read pointer is incremented and decremented by the size.

6. The method of claim 1 , wherein selectively reading data from the reverse order bit stream in reverse order comprises: Copies of the data units are stored in a memory in reverse order, and the reverse order data units are read in forward order starting at the beginning of the reverse order data units.

7. The method of claim 1 , wherein determining the length of the data unit comprises one of: detecting an end of the data unit based on a synchronization codeword; Read a length value from the preamble; or Get the data unit length from higher-level metadata.

8. The method of claim 1, further comprising determining that decoding of the forward sequence bit stream and the reverse sequence bit stream is complete and discarding any bits present for byte alignment.

9. The method of claim 8, further comprising decoding additional data located between the forward sequential bit stream and the reverse sequential bit stream in the data unit.

10. A method for transmitting coded data, wherein the coded data comprises a first bitstream of entropy coded symbols and a second bitstream of bypassed non-entropy coded symbols, the method comprising: buffering the first bitstream and the second bitstream; reversing one of the first bitstream and the second bitstream to create a reverse order bitstream, wherein the other of the first bitstream and the second bitstream is a forward order bitstream; generating a data unit, wherein the data unit sequentially includes a preamble, the forward sequence bit stream, and the reverse sequence bit stream; and The data unit is output.

11. A decoder for reconstructing encoded data from data units, the decoder comprising: at least one processor; Memory; as well as A decoding application comprising processor-executable instructions, wherein when the processor-executable instructions are executed by the at least one processor, the decoder performs the following actions: receiving the data unit, wherein the data unit sequentially includes a preamble and a payload, wherein the payload sequentially includes a forward sequence bit stream and a reverse sequence bit stream; determining the length of the data unit; selectively reading data from the forward sequence bit stream in the forward sequence or reading data from the reverse sequence bit stream in reverse sequence in response to a request for a symbol from a decoding unit; and decoding the data in the decoding unit to reconstruct the symbols, One of the forward sequence bit stream and the reverse sequence bit stream includes entropy coded symbols, and the other of the forward sequence bit stream and the reverse sequence bit stream includes bypassed non-entropy coded symbols.

12. The decoder of claim 11, wherein the request for a symbol indicates whether a symbol type is entropy coded or bypass non-entropy coded, and wherein selectively reading data of the forward sequential bit stream or the reverse sequential bit stream is based on the symbol type.

13. A decoder according to claim 11 or 12, wherein the processor-executable instructions, when executed, further cause the decoder to initialize a forward read pointer at the beginning of the forward sequential bit stream after the preamble, and to initialize a reverse read pointer at the end of the data unit.

14. The decoder of claim 13 , wherein the processor-executable instructions, when executed, cause the decoder to: read data from the forward sequential bit stream by reading the data indicated by the forward read pointer and then incrementing the forward read pointer, and wherein the processor-executable instructions, when executed, cause the decoder to: read data from the reverse sequential bit stream by reading the data indicated by the reverse read pointer and then decrementing the reverse read pointer.

15. The decoder of claim 14, wherein the data has a size of one or more bytes, and wherein the forward read pointer or the reverse read pointer is incremented and decremented by the size.

16. The decoder of claim 11 , wherein the processor-executable instructions, when executed, cause the decoder to selectively read data from the reverse sequence bit stream in reverse order by storing copies of the data units in a memory in reverse order and reading the reverse sequence data units in forward order starting from the beginning of the reverse sequence data units.

17. The decoder of claim 11 , wherein the processor-executable instructions, when executed, cause the decoder to determine the length of the data unit by one of: detecting an end of the data unit based on a synchronization codeword; Read a length value from the preamble; or Get the data unit length from higher-level metadata.

18. The decoder of claim 11, wherein the processor-executable instructions, when executed, further cause the decoder to: determine that decoding of the forward sequence bit stream and the reverse sequence bit stream is complete, and discard any bits present for byte alignment.

19. The decoder of claim 18, wherein the processor-executable instructions, when executed, further cause the decoder to: decode additional data located between the forward sequential bit stream and the reverse sequential bit stream in the data unit.

20. An encoder for transmitting coded data, wherein the coded data comprises a first bitstream of entropy coded symbols and a second bitstream of bypassed non-entropy coded symbols, the encoder comprising: at least one processor; Memory; as well as an encoding application comprising processor-executable instructions, wherein the processor-executable instructions, when executed by the at least one processor, cause the encoder to: buffering the first bitstream and the second bitstream; reversing one of the first bitstream and the second bitstream to create a reverse order bitstream, wherein the other of the first bitstream and the second bitstream is a forward order bitstream; generating a data unit, wherein the data unit sequentially includes a preamble, the forward sequence bit stream, and the reverse sequence bit stream; and The data unit is output.

Citation Information

Patent Citations

  • Entropy encoding device and method, entropy decoding scheme device and method, storage medium

    CN107317586A