diff options
author | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 14:59:13 +0000 |
---|---|---|
committer | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 14:59:13 +0000 |
commit | b6207ced7803f1aa72ca31c02705d148ef718cd8 (patch) | |
tree | 09e7b4b4c346f4b43692e8a626d4a77a4f2ac19c /third_party/libwebp/bits.c | |
parent | 563fccc387f4dd8cd6b51cc4306b757a9fc3a3a1 (diff) | |
download | chromium_src-b6207ced7803f1aa72ca31c02705d148ef718cd8.zip chromium_src-b6207ced7803f1aa72ca31c02705d148ef718cd8.tar.gz chromium_src-b6207ced7803f1aa72ca31c02705d148ef718cd8.tar.bz2 |
Revert 61787 - Add WebP library to Chromium
BUG=58225
TEST=library buildable on all platforms.
Review URL: http://codereview.chromium.org/3614010
TBR=fbarchard@chromium.org
Review URL: http://codereview.chromium.org/3608014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61788 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libwebp/bits.c')
-rw-r--r-- | third_party/libwebp/bits.c | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/third_party/libwebp/bits.c b/third_party/libwebp/bits.c deleted file mode 100644 index bdc89e0..0000000 --- a/third_party/libwebp/bits.c +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2010 Google Inc. -// -// This code is licensed under the same terms as WebM: -// Software License Agreement: http://www.webmproject.org/license/software/ -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ -// ----------------------------------------------------------------------------- -// -// Boolean decoder -// -// Author: Skal (pascal.massimino@gmail.com) - -#include "bits.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -//----------------------------------------------------------------------------- -// VP8BitReader - -int VP8Init(VP8BitReader* const br, const uint8_t* buf, uint32_t size) { - if (!br || !buf || size < 2) { - return 0; - } - br->buf_ = buf + 2; - br->buf_end_ = buf + size; - br->left_ = -8; - br->value_ = (buf[0] << 8) | buf[1]; - br->range_ = 255 - 1; - return 1; -} - -const uint8_t kVP8Log2Range[128] = { - 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0 -}; - -// range = ((range + 1) << kVP8Log2Range[range]) - 1 -const uint8_t kVP8NewRange[128] = { - 127, 127, 191, 127, 159, 191, 223, 127, 143, 159, 175, 191, 207, 223, 239, - 127, 135, 143, 151, 159, 167, 175, 183, 191, 199, 207, 215, 223, 231, 239, - 247, 127, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, - 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239, - 243, 247, 251, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, - 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, - 181, 183, 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, - 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, - 241, 243, 245, 247, 249, 251, 253, 127 -}; - -//----------------------------------------------------------------------------- -// Higher-level calls - -uint32_t VP8GetValue(VP8BitReader* const br, int bits) { - uint32_t v = 0; - while (bits-- > 0) { - v |= VP8GetBit(br, 0x80) << bits; - } - return v; -} - -int32_t VP8GetSignedValue(VP8BitReader* const br, int bits) { - const int value = (bits > 0) ? VP8GetValue(br, bits) : 0; - return VP8Get(br) ? -value : value; -} - -//----------------------------------------------------------------------------- - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif |