Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license |
michael@0 | 5 | * that can be found in the LICENSE file in the root of the source |
michael@0 | 6 | * tree. An additional intellectual property rights grant can be found |
michael@0 | 7 | * in the file PATENTS. All contributing project authors may |
michael@0 | 8 | * be found in the AUTHORS file in the root of the source tree. |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | #ifndef VP9_COMMON_VP9_SEG_COMMON_H_ |
michael@0 | 12 | #define VP9_COMMON_VP9_SEG_COMMON_H_ |
michael@0 | 13 | |
michael@0 | 14 | #include "vp9/common/vp9_treecoder.h" |
michael@0 | 15 | |
michael@0 | 16 | #define SEGMENT_DELTADATA 0 |
michael@0 | 17 | #define SEGMENT_ABSDATA 1 |
michael@0 | 18 | |
michael@0 | 19 | #define MAX_SEGMENTS 8 |
michael@0 | 20 | #define SEG_TREE_PROBS (MAX_SEGMENTS-1) |
michael@0 | 21 | |
michael@0 | 22 | #define PREDICTION_PROBS 3 |
michael@0 | 23 | |
michael@0 | 24 | // Segment level features. |
michael@0 | 25 | typedef enum { |
michael@0 | 26 | SEG_LVL_ALT_Q = 0, // Use alternate Quantizer .... |
michael@0 | 27 | SEG_LVL_ALT_LF = 1, // Use alternate loop filter value... |
michael@0 | 28 | SEG_LVL_REF_FRAME = 2, // Optional Segment reference frame |
michael@0 | 29 | SEG_LVL_SKIP = 3, // Optional Segment (0,0) + skip mode |
michael@0 | 30 | SEG_LVL_MAX = 4 // Number of features supported |
michael@0 | 31 | } SEG_LVL_FEATURES; |
michael@0 | 32 | |
michael@0 | 33 | |
michael@0 | 34 | struct segmentation { |
michael@0 | 35 | uint8_t enabled; |
michael@0 | 36 | uint8_t update_map; |
michael@0 | 37 | uint8_t update_data; |
michael@0 | 38 | uint8_t abs_delta; |
michael@0 | 39 | uint8_t temporal_update; |
michael@0 | 40 | |
michael@0 | 41 | vp9_prob tree_probs[SEG_TREE_PROBS]; |
michael@0 | 42 | vp9_prob pred_probs[PREDICTION_PROBS]; |
michael@0 | 43 | |
michael@0 | 44 | int16_t feature_data[MAX_SEGMENTS][SEG_LVL_MAX]; |
michael@0 | 45 | unsigned int feature_mask[MAX_SEGMENTS]; |
michael@0 | 46 | }; |
michael@0 | 47 | |
michael@0 | 48 | int vp9_segfeature_active(const struct segmentation *seg, |
michael@0 | 49 | int segment_id, |
michael@0 | 50 | SEG_LVL_FEATURES feature_id); |
michael@0 | 51 | |
michael@0 | 52 | void vp9_clearall_segfeatures(struct segmentation *seg); |
michael@0 | 53 | |
michael@0 | 54 | void vp9_enable_segfeature(struct segmentation *seg, |
michael@0 | 55 | int segment_id, |
michael@0 | 56 | SEG_LVL_FEATURES feature_id); |
michael@0 | 57 | |
michael@0 | 58 | void vp9_disable_segfeature(struct segmentation *seg, |
michael@0 | 59 | int segment_id, |
michael@0 | 60 | SEG_LVL_FEATURES feature_id); |
michael@0 | 61 | |
michael@0 | 62 | int vp9_seg_feature_data_max(SEG_LVL_FEATURES feature_id); |
michael@0 | 63 | |
michael@0 | 64 | int vp9_is_segfeature_signed(SEG_LVL_FEATURES feature_id); |
michael@0 | 65 | |
michael@0 | 66 | void vp9_clear_segdata(struct segmentation *seg, |
michael@0 | 67 | int segment_id, |
michael@0 | 68 | SEG_LVL_FEATURES feature_id); |
michael@0 | 69 | |
michael@0 | 70 | void vp9_set_segdata(struct segmentation *seg, |
michael@0 | 71 | int segment_id, |
michael@0 | 72 | SEG_LVL_FEATURES feature_id, |
michael@0 | 73 | int seg_data); |
michael@0 | 74 | |
michael@0 | 75 | int vp9_get_segdata(const struct segmentation *seg, |
michael@0 | 76 | int segment_id, |
michael@0 | 77 | SEG_LVL_FEATURES feature_id); |
michael@0 | 78 | |
michael@0 | 79 | extern const vp9_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)]; |
michael@0 | 80 | |
michael@0 | 81 | #endif // VP9_COMMON_VP9_SEG_COMMON_H_ |
michael@0 | 82 |