OLD | NEW |
1 // Copyright 2010 Google Inc. All Rights Reserved. | 1 // Copyright 2010 Google Inc. All Rights Reserved. |
2 // | 2 // |
3 // Use of this source code is governed by a BSD-style license | 3 // Use of this source code is governed by a BSD-style license |
4 // that can be found in the COPYING file in the root of the source | 4 // that can be found in the COPYING file in the root of the source |
5 // tree. An additional intellectual property rights grant can be found | 5 // tree. An additional intellectual property rights grant can be found |
6 // in the file PATENTS. All contributing project authors may | 6 // in the file PATENTS. All contributing project authors may |
7 // be found in the AUTHORS file in the root of the source tree. | 7 // be found in the AUTHORS file in the root of the source tree. |
8 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
9 // | 9 // |
10 // Coding trees and probas | 10 // Coding trees and probas |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } | 487 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } |
488 }, | 488 }, |
489 { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, | 489 { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, |
490 { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, | 490 { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, |
491 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } | 491 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } |
492 } | 492 } |
493 } | 493 } |
494 }; | 494 }; |
495 | 495 |
496 // Paragraph 9.9 | 496 // Paragraph 9.9 |
| 497 |
| 498 static const int kBands[16 + 1] = { |
| 499 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, |
| 500 0 // extra entry as sentinel |
| 501 }; |
| 502 |
497 void VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec) { | 503 void VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec) { |
498 VP8Proba* const proba = &dec->proba_; | 504 VP8Proba* const proba = &dec->proba_; |
499 int t, b, c, p; | 505 int t, b, c, p; |
500 for (t = 0; t < NUM_TYPES; ++t) { | 506 for (t = 0; t < NUM_TYPES; ++t) { |
501 for (b = 0; b < NUM_BANDS; ++b) { | 507 for (b = 0; b < NUM_BANDS; ++b) { |
502 for (c = 0; c < NUM_CTX; ++c) { | 508 for (c = 0; c < NUM_CTX; ++c) { |
503 for (p = 0; p < NUM_PROBAS; ++p) { | 509 for (p = 0; p < NUM_PROBAS; ++p) { |
504 const int v = VP8GetBit(br, CoeffsUpdateProba[t][b][c][p]) ? | 510 const int v = VP8GetBit(br, CoeffsUpdateProba[t][b][c][p]) ? |
505 VP8GetValue(br, 8) : CoeffsProba0[t][b][c][p]; | 511 VP8GetValue(br, 8) : CoeffsProba0[t][b][c][p]; |
506 proba->bands_[t][b].probas_[c][p] = v; | 512 proba->bands_[t][b].probas_[c][p] = v; |
507 } | 513 } |
508 } | 514 } |
509 } | 515 } |
| 516 for (b = 0; b < 16 + 1; ++b) { |
| 517 proba->bands_ptr_[t][b] = &proba->bands_[t][kBands[b]]; |
| 518 } |
510 } | 519 } |
511 dec->use_skip_proba_ = VP8Get(br); | 520 dec->use_skip_proba_ = VP8Get(br); |
512 if (dec->use_skip_proba_) { | 521 if (dec->use_skip_proba_) { |
513 dec->skip_p_ = VP8GetValue(br, 8); | 522 dec->skip_p_ = VP8GetValue(br, 8); |
514 } | 523 } |
515 } | 524 } |
516 | 525 |
OLD | NEW |