Data compression device, data decompression device, and memory system
According to one embodiment, a data compression device includes all-literal determination circuitry and end-of-block symbol addition circuitry. In a case where dictionary-based compression on a first data block is performed, the all-literal determination circuitry determines whether all one or more symbols in a second data block are literal symbols. The symbols are obtained by performing the dictionary-based compression on the first data block. When all the symbols are literal symbols, end-of-block symbol addition circuitry does not add an end-of-block symbol to an end of the second data block. When at least one symbol among the symbols is not a literal symbol, the end-of-block symbol addition circuitry adds the end-of-block symbol to the end of the second data block.
1 . A data decompression device comprising:
all-literal determination circuitry configured to determine whether or not all one or more symbols that are obtained by performing entropy decoding on compressed data are literal symbols;
block boundary determination circuitry configured to:
calculate a first data size of data to be obtained by performing dictionary-based decompression on the one or more symbols; and
in a case where all the one or more symbols are literal symbols, output a first information indicating that a symbol of the one or more symbols corresponds to an end of a data block, based on the first data size and information indicative of a size of an uncompressed data block; and
end-of-block symbol detection circuitry configured to, in a case where at least one symbol among the one or more symbols is not a literal symbol, output a second information indicating that a symbol of the one or more symbols corresponds to the end of the data block, based on the symbol of the one or more symbols.
2 . The data decompression device according to claim 1 , wherein
the compressed data includes a third information indicating whether all the one or more symbols are literal symbols or not, and
the all-literal determination circuitry is configured to determine whether all the one or more symbols are literal symbols or not, based on the third information.
3 . The data decompression device according to claim 1 , wherein
the block boundary determination circuitry is configured to calculate the first data size based on a number of the one or more symbols.
4 . The data decompression device according to claim 3 , wherein
the block boundary determination circuitry is configured to output the first information in a case where the first data size is equal to the size of the uncompressed data block.
5 . The data decompression device according to claim 1 , wherein
the end-of-block symbol detection circuitry is configured to:
determine whether a symbol of the one or more symbols is an end-of-block symbol or not; and
in a case where the symbol of the one or more symbols is the end-of-block symbol, output the second information.
6 . The data decompression device according to claim 5 , wherein
the end-of-block symbol detection circuitry is configured to, in a case where a symbol of one or more symbols is the end-of-block symbol, output the second information to the block boundary determination circuitry.
7 . The data decompression device according to claim 1 , further comprising:
decoding circuitry configured to:
generate the one or more symbols by performing the entropy decoding on the compressed data by using a first coding table obtained from the compressed data; and
in a case where the first information is output or in a case where the second information is output, generate one or more subsequent symbols to the one or more symbols by performing the entropy decoding on the compressed data by using a second coding table that is different from the first coding table and is obtained from the compressed data.
8 . The data decompression device according to claim 1 , further comprising
decoding circuitry configured to generate the one or more symbols by performing the entropy decoding on one or more variable-length codes included in the compressed data,
wherein the block boundary determination circuitry is configured to:
calculate a second data size of the one or more variable-length codes; and
in a case where all the one or more symbols are literal symbols, output the first information, based on the second data size and a third information that indicates a size of a second data block obtained by performing dictionary-based compression and entropy coding on a first data block.
9 . The data decompression device according to claim 8 , wherein
the block boundary determination circuitry is configured to output the first information in a case where the second data size is equal to the size of the second data block.
10 . The data decompression device according to claim 8 , wherein
the compressed data includes the third information.
11 . A memory system comprising:
a nonvolatile memory; and
controller circuitry including the data decompression device according to claim 1 and configured to read the compressed data from the nonvolatile memory.