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

Unified Diff: third_party/libwebp/dec/tree.c

Issue 421003002: libwebp: update to 0.4.1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 0.4.1-final Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libwebp/dec/layer.c ('k') | third_party/libwebp/dec/vp8.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libwebp/dec/tree.c
diff --git a/third_party/libwebp/dec/tree.c b/third_party/libwebp/dec/tree.c
index bf9b7c551a13cf17a7f5ba2a35c2ea296eb93519..88238885d32551a327b5335791beb434c01e67f7 100644
--- a/third_party/libwebp/dec/tree.c
+++ b/third_party/libwebp/dec/tree.c
@@ -12,6 +12,7 @@
// Author: Skal (pascal.massimino@gmail.com)
#include "vp8i.h"
+#include "../utils/bit_reader_inl.h"
#define USE_GENERIC_TREE
@@ -278,10 +279,23 @@ void VP8ResetProba(VP8Proba* const proba) {
// proba->bands_[][] is initialized later
}
-void VP8ParseIntraMode(VP8BitReader* const br, VP8Decoder* const dec) {
- uint8_t* const top = dec->intra_t_ + 4 * dec->mb_x_;
+static void ParseIntraMode(VP8BitReader* const br,
+ VP8Decoder* const dec, int mb_x) {
+ uint8_t* const top = dec->intra_t_ + 4 * mb_x;
uint8_t* const left = dec->intra_l_;
- VP8MBData* const block = dec->mb_data_ + dec->mb_x_;
+ VP8MBData* const block = dec->mb_data_ + mb_x;
+
+ // Note: we don't save segment map (yet), as we don't expect
+ // to decode more than 1 keyframe.
+ if (dec->segment_hdr_.update_map_) {
+ // Hardcoded tree parsing
+ block->segment_ = !VP8GetBit(br, dec->proba_.segments_[0])
+ ? VP8GetBit(br, dec->proba_.segments_[1])
+ : 2 + VP8GetBit(br, dec->proba_.segments_[2]);
+ } else {
+ block->segment_ = 0; // default for intra
+ }
+ if (dec->use_skip_proba_) block->skip_ = VP8GetBit(br, dec->skip_p_);
block->is_i4x4_ = !VP8GetBit(br, 145); // decide for B_PRED first
if (!block->is_i4x4_) {
@@ -332,6 +346,14 @@ void VP8ParseIntraMode(VP8BitReader* const br, VP8Decoder* const dec) {
: VP8GetBit(br, 183) ? TM_PRED : H_PRED;
}
+int VP8ParseIntraModeRow(VP8BitReader* const br, VP8Decoder* const dec) {
+ int mb_x;
+ for (mb_x = 0; mb_x < dec->mb_w_; ++mb_x) {
+ ParseIntraMode(br, dec, mb_x);
+ }
+ return !dec->br_.eof_;
+}
+
//------------------------------------------------------------------------------
// Paragraph 13
« no previous file with comments | « third_party/libwebp/dec/layer.c ('k') | third_party/libwebp/dec/vp8.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698