|
12 | 12 | #include "zstd_lazy.h"
|
13 | 13 | #include "../common/bits.h" /* ZSTD_countTrailingZeros64 */
|
14 | 14 |
|
| 15 | +#if !defined(ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR) \ |
| 16 | + || !defined(ZSTD_EXCLUDE_LAZY_BLOCK_COMPRESSOR) \ |
| 17 | + || !defined(ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR) \ |
| 18 | + || !defined(ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR) |
| 19 | + |
15 | 20 | #define kLazySkippingStep 8
|
16 | 21 |
|
17 | 22 |
|
@@ -1754,151 +1759,194 @@ ZSTD_compressBlock_lazy_generic(
|
1754 | 1759 | /* Return the last literals size */
|
1755 | 1760 | return (size_t)(iend - anchor);
|
1756 | 1761 | }
|
| 1762 | +#endif /* build exclusions */ |
1757 | 1763 |
|
1758 | 1764 |
|
| 1765 | +#ifndef ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR |
1759 | 1766 | size_t ZSTD_compressBlock_btlazy2(
|
1760 | 1767 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1761 | 1768 | void const* src, size_t srcSize)
|
1762 | 1769 | {
|
1763 | 1770 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_binaryTree, 2, ZSTD_noDict);
|
1764 | 1771 | }
|
| 1772 | +#endif |
1765 | 1773 |
|
| 1774 | +#ifndef ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR |
1766 | 1775 | size_t ZSTD_compressBlock_lazy2(
|
1767 | 1776 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1768 | 1777 | void const* src, size_t srcSize)
|
1769 | 1778 | {
|
1770 | 1779 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 2, ZSTD_noDict);
|
1771 | 1780 | }
|
| 1781 | +#endif |
1772 | 1782 |
|
| 1783 | +#ifndef ZSTD_EXCLUDE_LAZY_BLOCK_COMPRESSOR |
1773 | 1784 | size_t ZSTD_compressBlock_lazy(
|
1774 | 1785 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1775 | 1786 | void const* src, size_t srcSize)
|
1776 | 1787 | {
|
1777 | 1788 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 1, ZSTD_noDict);
|
1778 | 1789 | }
|
| 1790 | +#endif |
1779 | 1791 |
|
| 1792 | +#ifndef ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR |
1780 | 1793 | size_t ZSTD_compressBlock_greedy(
|
1781 | 1794 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1782 | 1795 | void const* src, size_t srcSize)
|
1783 | 1796 | {
|
1784 | 1797 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 0, ZSTD_noDict);
|
1785 | 1798 | }
|
| 1799 | +#endif |
1786 | 1800 |
|
| 1801 | +#ifndef ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR |
1787 | 1802 | size_t ZSTD_compressBlock_btlazy2_dictMatchState(
|
1788 | 1803 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1789 | 1804 | void const* src, size_t srcSize)
|
1790 | 1805 | {
|
1791 | 1806 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_binaryTree, 2, ZSTD_dictMatchState);
|
1792 | 1807 | }
|
| 1808 | +#endif |
1793 | 1809 |
|
| 1810 | +#ifndef ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR |
1794 | 1811 | size_t ZSTD_compressBlock_lazy2_dictMatchState(
|
1795 | 1812 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1796 | 1813 | void const* src, size_t srcSize)
|
1797 | 1814 | {
|
1798 | 1815 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 2, ZSTD_dictMatchState);
|
1799 | 1816 | }
|
| 1817 | +#endif |
1800 | 1818 |
|
| 1819 | +#ifndef ZSTD_EXCLUDE_LAZY_BLOCK_COMPRESSOR |
1801 | 1820 | size_t ZSTD_compressBlock_lazy_dictMatchState(
|
1802 | 1821 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1803 | 1822 | void const* src, size_t srcSize)
|
1804 | 1823 | {
|
1805 | 1824 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 1, ZSTD_dictMatchState);
|
1806 | 1825 | }
|
| 1826 | +#endif |
1807 | 1827 |
|
| 1828 | +#ifndef ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR |
1808 | 1829 | size_t ZSTD_compressBlock_greedy_dictMatchState(
|
1809 | 1830 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1810 | 1831 | void const* src, size_t srcSize)
|
1811 | 1832 | {
|
1812 | 1833 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 0, ZSTD_dictMatchState);
|
1813 | 1834 | }
|
| 1835 | +#endif |
1814 | 1836 |
|
1815 |
| - |
| 1837 | +#ifndef ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR |
1816 | 1838 | size_t ZSTD_compressBlock_lazy2_dedicatedDictSearch(
|
1817 | 1839 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1818 | 1840 | void const* src, size_t srcSize)
|
1819 | 1841 | {
|
1820 | 1842 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 2, ZSTD_dedicatedDictSearch);
|
1821 | 1843 | }
|
| 1844 | +#endif |
1822 | 1845 |
|
| 1846 | +#ifndef ZSTD_EXCLUDE_LAZY_BLOCK_COMPRESSOR |
1823 | 1847 | size_t ZSTD_compressBlock_lazy_dedicatedDictSearch(
|
1824 | 1848 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1825 | 1849 | void const* src, size_t srcSize)
|
1826 | 1850 | {
|
1827 | 1851 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 1, ZSTD_dedicatedDictSearch);
|
1828 | 1852 | }
|
| 1853 | +#endif |
1829 | 1854 |
|
| 1855 | +#ifndef ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR |
1830 | 1856 | size_t ZSTD_compressBlock_greedy_dedicatedDictSearch(
|
1831 | 1857 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1832 | 1858 | void const* src, size_t srcSize)
|
1833 | 1859 | {
|
1834 | 1860 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 0, ZSTD_dedicatedDictSearch);
|
1835 | 1861 | }
|
| 1862 | +#endif |
1836 | 1863 |
|
1837 | 1864 | /* Row-based matchfinder */
|
| 1865 | +#ifndef ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR |
1838 | 1866 | size_t ZSTD_compressBlock_lazy2_row(
|
1839 | 1867 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1840 | 1868 | void const* src, size_t srcSize)
|
1841 | 1869 | {
|
1842 | 1870 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 2, ZSTD_noDict);
|
1843 | 1871 | }
|
| 1872 | +#endif |
1844 | 1873 |
|
| 1874 | +#ifndef ZSTD_EXCLUDE_LAZY_BLOCK_COMPRESSOR |
1845 | 1875 | size_t ZSTD_compressBlock_lazy_row(
|
1846 | 1876 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1847 | 1877 | void const* src, size_t srcSize)
|
1848 | 1878 | {
|
1849 | 1879 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 1, ZSTD_noDict);
|
1850 | 1880 | }
|
| 1881 | +#endif |
1851 | 1882 |
|
| 1883 | +#ifndef ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR |
1852 | 1884 | size_t ZSTD_compressBlock_greedy_row(
|
1853 | 1885 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1854 | 1886 | void const* src, size_t srcSize)
|
1855 | 1887 | {
|
1856 | 1888 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 0, ZSTD_noDict);
|
1857 | 1889 | }
|
| 1890 | +#endif |
1858 | 1891 |
|
| 1892 | +#ifndef ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR |
1859 | 1893 | size_t ZSTD_compressBlock_lazy2_dictMatchState_row(
|
1860 | 1894 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1861 | 1895 | void const* src, size_t srcSize)
|
1862 | 1896 | {
|
1863 | 1897 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 2, ZSTD_dictMatchState);
|
1864 | 1898 | }
|
| 1899 | +#endif |
1865 | 1900 |
|
| 1901 | +#ifndef ZSTD_EXCLUDE_LAZY_BLOCK_COMPRESSOR |
1866 | 1902 | size_t ZSTD_compressBlock_lazy_dictMatchState_row(
|
1867 | 1903 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1868 | 1904 | void const* src, size_t srcSize)
|
1869 | 1905 | {
|
1870 | 1906 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 1, ZSTD_dictMatchState);
|
1871 | 1907 | }
|
| 1908 | +#endif |
1872 | 1909 |
|
| 1910 | +#ifndef ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR |
1873 | 1911 | size_t ZSTD_compressBlock_greedy_dictMatchState_row(
|
1874 | 1912 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1875 | 1913 | void const* src, size_t srcSize)
|
1876 | 1914 | {
|
1877 | 1915 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 0, ZSTD_dictMatchState);
|
1878 | 1916 | }
|
| 1917 | +#endif |
1879 | 1918 |
|
1880 |
| - |
| 1919 | +#ifndef ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR |
1881 | 1920 | size_t ZSTD_compressBlock_lazy2_dedicatedDictSearch_row(
|
1882 | 1921 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1883 | 1922 | void const* src, size_t srcSize)
|
1884 | 1923 | {
|
1885 | 1924 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 2, ZSTD_dedicatedDictSearch);
|
1886 | 1925 | }
|
| 1926 | +#endif |
1887 | 1927 |
|
| 1928 | +#ifndef ZSTD_EXCLUDE_LAZY_BLOCK_COMPRESSOR |
1888 | 1929 | size_t ZSTD_compressBlock_lazy_dedicatedDictSearch_row(
|
1889 | 1930 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1890 | 1931 | void const* src, size_t srcSize)
|
1891 | 1932 | {
|
1892 | 1933 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 1, ZSTD_dedicatedDictSearch);
|
1893 | 1934 | }
|
| 1935 | +#endif |
1894 | 1936 |
|
| 1937 | +#ifndef ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR |
1895 | 1938 | size_t ZSTD_compressBlock_greedy_dedicatedDictSearch_row(
|
1896 | 1939 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
1897 | 1940 | void const* src, size_t srcSize)
|
1898 | 1941 | {
|
1899 | 1942 | return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 0, ZSTD_dedicatedDictSearch);
|
1900 | 1943 | }
|
| 1944 | +#endif |
1901 | 1945 |
|
| 1946 | +#if !defined(ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR) \ |
| 1947 | + || !defined(ZSTD_EXCLUDE_LAZY_BLOCK_COMPRESSOR) \ |
| 1948 | + || !defined(ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR) \ |
| 1949 | + || !defined(ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR) |
1902 | 1950 | FORCE_INLINE_TEMPLATE
|
1903 | 1951 | size_t ZSTD_compressBlock_lazy_extDict_generic(
|
1904 | 1952 | ZSTD_matchState_t* ms, seqStore_t* seqStore,
|
@@ -2101,57 +2149,71 @@ size_t ZSTD_compressBlock_lazy_extDict_generic(
|
2101 | 2149 | /* Return the last literals size */
|
2102 | 2150 | return (size_t)(iend - anchor);
|
2103 | 2151 | }
|
| 2152 | +#endif /* build exclusions */ |
2104 | 2153 |
|
2105 |
| - |
| 2154 | +#ifndef ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR |
2106 | 2155 | size_t ZSTD_compressBlock_greedy_extDict(
|
2107 | 2156 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
2108 | 2157 | void const* src, size_t srcSize)
|
2109 | 2158 | {
|
2110 | 2159 | return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 0);
|
2111 | 2160 | }
|
| 2161 | +#endif |
2112 | 2162 |
|
| 2163 | +#ifndef ZSTD_EXCLUDE_LAZY_BLOCK_COMPRESSOR |
2113 | 2164 | size_t ZSTD_compressBlock_lazy_extDict(
|
2114 | 2165 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
2115 | 2166 | void const* src, size_t srcSize)
|
2116 | 2167 |
|
2117 | 2168 | {
|
2118 | 2169 | return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 1);
|
2119 | 2170 | }
|
| 2171 | +#endif |
2120 | 2172 |
|
| 2173 | +#ifndef ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR |
2121 | 2174 | size_t ZSTD_compressBlock_lazy2_extDict(
|
2122 | 2175 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
2123 | 2176 | void const* src, size_t srcSize)
|
2124 | 2177 |
|
2125 | 2178 | {
|
2126 | 2179 | return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 2);
|
2127 | 2180 | }
|
| 2181 | +#endif |
2128 | 2182 |
|
| 2183 | +#ifndef ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR |
2129 | 2184 | size_t ZSTD_compressBlock_btlazy2_extDict(
|
2130 | 2185 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
2131 | 2186 | void const* src, size_t srcSize)
|
2132 | 2187 |
|
2133 | 2188 | {
|
2134 | 2189 | return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_binaryTree, 2);
|
2135 | 2190 | }
|
| 2191 | +#endif |
2136 | 2192 |
|
| 2193 | +#ifndef ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR |
2137 | 2194 | size_t ZSTD_compressBlock_greedy_extDict_row(
|
2138 | 2195 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
2139 | 2196 | void const* src, size_t srcSize)
|
2140 | 2197 | {
|
2141 | 2198 | return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 0);
|
2142 | 2199 | }
|
| 2200 | +#endif |
2143 | 2201 |
|
| 2202 | +#ifndef ZSTD_EXCLUDE_LAZY_BLOCK_COMPRESSOR |
2144 | 2203 | size_t ZSTD_compressBlock_lazy_extDict_row(
|
2145 | 2204 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
2146 | 2205 | void const* src, size_t srcSize)
|
2147 | 2206 |
|
2148 | 2207 | {
|
2149 | 2208 | return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 1);
|
2150 | 2209 | }
|
| 2210 | +#endif |
2151 | 2211 |
|
| 2212 | +#ifndef ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR |
2152 | 2213 | size_t ZSTD_compressBlock_lazy2_extDict_row(
|
2153 | 2214 | ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
2154 | 2215 | void const* src, size_t srcSize)
|
2155 | 2216 | {
|
2156 | 2217 | return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 2);
|
2157 | 2218 | }
|
| 2219 | +#endif |
0 commit comments