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

Side by Side Diff: source/libvpx/vp8/decoder/dboolhuff.c

Issue 17451020: libvpx: Pull from upstream (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/test/variance_test.cc ('k') | source/libvpx/vp9/common/vp9_debugmodes.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 29 matching lines...) Expand all
40 VP8_BD_VALUE value = br->value; 40 VP8_BD_VALUE value = br->value;
41 int count = br->count; 41 int count = br->count;
42 int shift = VP8_BD_VALUE_SIZE - 8 - (count + 8); 42 int shift = VP8_BD_VALUE_SIZE - 8 - (count + 8);
43 size_t bytes_left = br->user_buffer_end - bufptr; 43 size_t bytes_left = br->user_buffer_end - bufptr;
44 size_t bits_left = bytes_left * CHAR_BIT; 44 size_t bits_left = bytes_left * CHAR_BIT;
45 int x = (int)(shift + CHAR_BIT - bits_left); 45 int x = (int)(shift + CHAR_BIT - bits_left);
46 int loop_end = 0; 46 int loop_end = 0;
47 unsigned char decrypted[sizeof(VP8_BD_VALUE) + 1]; 47 unsigned char decrypted[sizeof(VP8_BD_VALUE) + 1];
48 48
49 if (br->decrypt_cb) { 49 if (br->decrypt_cb) {
50 int n = bytes_left > sizeof(decrypted) ? sizeof(decrypted) : bytes_left; 50 size_t n = bytes_left > sizeof(decrypted) ? sizeof(decrypted) : bytes_le ft;
51 br->decrypt_cb(br->decrypt_state, bufptr, decrypted, n); 51 br->decrypt_cb(br->decrypt_state, bufptr, decrypted, (int)n);
52 bufptr = decrypted; 52 bufptr = decrypted;
53 } 53 }
54 54
55 if(x >= 0) 55 if(x >= 0)
56 { 56 {
57 count += VP8_LOTS_OF_BITS; 57 count += VP8_LOTS_OF_BITS;
58 loop_end = x; 58 loop_end = x;
59 } 59 }
60 60
61 if (x < 0 || bits_left) 61 if (x < 0 || bits_left)
62 { 62 {
63 while(shift >= loop_end) 63 while(shift >= loop_end)
64 { 64 {
65 count += CHAR_BIT; 65 count += CHAR_BIT;
66 value |= (VP8_BD_VALUE)*bufptr << shift; 66 value |= (VP8_BD_VALUE)*bufptr << shift;
67 ++bufptr; 67 ++bufptr;
68 ++br->user_buffer; 68 ++br->user_buffer;
69 shift -= CHAR_BIT; 69 shift -= CHAR_BIT;
70 } 70 }
71 } 71 }
72 72
73 br->value = value; 73 br->value = value;
74 br->count = count; 74 br->count = count;
75 } 75 }
OLDNEW
« no previous file with comments | « source/libvpx/test/variance_test.cc ('k') | source/libvpx/vp9/common/vp9_debugmodes.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698