Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Unified Diff: third_party/brotli/enc/compress_fragment.h

Issue 2537133002: Update brotli to v1.0.0-snapshot. (Closed)
Patch Set: Fixed typo Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/brotli/enc/command.h ('k') | third_party/brotli/enc/compress_fragment.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/brotli/enc/compress_fragment.h
diff --git a/third_party/brotli/enc/compress_fragment.h b/third_party/brotli/enc/compress_fragment.h
index 7ce05fdfb2a9aadff81909aad77bbdf2ab9175a0..64e79872487c3772be4ffc9069386dff8e3c054a 100644
--- a/third_party/brotli/enc/compress_fragment.h
+++ b/third_party/brotli/enc/compress_fragment.h
@@ -4,44 +4,57 @@
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
-// Function for fast encoding of an input fragment, independently from the input
-// history. This function uses one-pass processing: when we find a backward
-// match, we immediately emit the corresponding command and literal codes to
-// the bit stream.
+/* Function for fast encoding of an input fragment, independently from the input
+ history. This function uses one-pass processing: when we find a backward
+ match, we immediately emit the corresponding command and literal codes to
+ the bit stream. */
#ifndef BROTLI_ENC_COMPRESS_FRAGMENT_H_
#define BROTLI_ENC_COMPRESS_FRAGMENT_H_
-#include "./types.h"
-
-namespace brotli {
-
-// Compresses "input" string to the "*storage" buffer as one or more complete
-// meta-blocks, and updates the "*storage_ix" bit position.
-//
-// If "is_last" is true, emits an additional empty last meta-block.
-//
-// "cmd_depth" and "cmd_bits" contain the command and distance prefix codes
-// (see comment in encode.h) used for the encoding of this input fragment.
-// If "is_last" is false, they are updated to reflect the statistics
-// of this input fragment, to be used for the encoding of the next fragment.
-//
-// "*cmd_code_numbits" is the number of bits of the compressed representation
-// of the command and distance prefix codes, and "cmd_code" is an array of
-// at least "(*cmd_code_numbits + 7) >> 3" size that contains the compressed
-// command and distance prefix codes. If "is_last" is false, these are also
-// updated to represent the updated "cmd_depth" and "cmd_bits".
-//
-// REQUIRES: "input_size" is greater than zero, or "is_last" is true.
-// REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero.
-// REQUIRES: "table_size" is a power of two
-void BrotliCompressFragmentFast(const uint8_t* input, size_t input_size,
- bool is_last,
- int* table, size_t table_size,
- uint8_t cmd_depth[128], uint16_t cmd_bits[128],
- size_t* cmd_code_numbits, uint8_t* cmd_code,
- size_t* storage_ix, uint8_t* storage);
-
-} // namespace brotli
-
-#endif // BROTLI_ENC_COMPRESS_FRAGMENT_H_
+#include <brotli/types.h>
+#include "./memory.h"
+#include "./port.h"
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+/* Compresses "input" string to the "*storage" buffer as one or more complete
+ meta-blocks, and updates the "*storage_ix" bit position.
+
+ If "is_last" is 1, emits an additional empty last meta-block.
+
+ "cmd_depth" and "cmd_bits" contain the command and distance prefix codes
+ (see comment in encode.h) used for the encoding of this input fragment.
+ If "is_last" is 0, they are updated to reflect the statistics
+ of this input fragment, to be used for the encoding of the next fragment.
+
+ "*cmd_code_numbits" is the number of bits of the compressed representation
+ of the command and distance prefix codes, and "cmd_code" is an array of
+ at least "(*cmd_code_numbits + 7) >> 3" size that contains the compressed
+ command and distance prefix codes. If "is_last" is 0, these are also
+ updated to represent the updated "cmd_depth" and "cmd_bits".
+
+ REQUIRES: "input_size" is greater than zero, or "is_last" is 1.
+ REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero.
+ REQUIRES: "table_size" is an odd (9, 11, 13, 15) power of two
+ OUTPUT: maximal copy distance <= |input_size|
+ OUTPUT: maximal copy distance <= MaxBackwardLimit(18) */
+BROTLI_INTERNAL void BrotliCompressFragmentFast(MemoryManager* m,
+ const uint8_t* input,
+ size_t input_size,
+ BROTLI_BOOL is_last,
+ int* table, size_t table_size,
+ uint8_t cmd_depth[128],
+ uint16_t cmd_bits[128],
+ size_t* cmd_code_numbits,
+ uint8_t* cmd_code,
+ size_t* storage_ix,
+ uint8_t* storage);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+} /* extern "C" */
+#endif
+
+#endif /* BROTLI_ENC_COMPRESS_FRAGMENT_H_ */
« no previous file with comments | « third_party/brotli/enc/command.h ('k') | third_party/brotli/enc/compress_fragment.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698