2
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
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
6
* tree. An additional intellectual property rights grant can be found
7
* in the file PATENTS. All contributing project authors may
8
* be found in the AUTHORS file in the root of the source tree.
11
#ifndef VP9_COMMON_VP9_SEG_COMMON_H_
12
#define VP9_COMMON_VP9_SEG_COMMON_H_
14
#include "vp9/common/vp9_treecoder.h"
16
#define SEGMENT_DELTADATA 0
17
#define SEGMENT_ABSDATA 1
19
#define MAX_SEGMENTS 8
20
#define SEG_TREE_PROBS (MAX_SEGMENTS-1)
22
#define PREDICTION_PROBS 3
24
// Segment level features.
26
SEG_LVL_ALT_Q = 0, // Use alternate Quantizer ....
27
SEG_LVL_ALT_LF = 1, // Use alternate loop filter value...
28
SEG_LVL_REF_FRAME = 2, // Optional Segment reference frame
29
SEG_LVL_SKIP = 3, // Optional Segment (0,0) + skip mode
30
SEG_LVL_MAX = 4 // Number of features supported
39
uint8_t temporal_update;
41
vp9_prob tree_probs[SEG_TREE_PROBS];
42
vp9_prob pred_probs[PREDICTION_PROBS];
44
int16_t feature_data[MAX_SEGMENTS][SEG_LVL_MAX];
45
unsigned int feature_mask[MAX_SEGMENTS];
48
int vp9_segfeature_active(const struct segmentation *seg,
50
SEG_LVL_FEATURES feature_id);
52
void vp9_clearall_segfeatures(struct segmentation *seg);
54
void vp9_enable_segfeature(struct segmentation *seg,
56
SEG_LVL_FEATURES feature_id);
58
void vp9_disable_segfeature(struct segmentation *seg,
60
SEG_LVL_FEATURES feature_id);
62
int vp9_seg_feature_data_max(SEG_LVL_FEATURES feature_id);
64
int vp9_is_segfeature_signed(SEG_LVL_FEATURES feature_id);
66
void vp9_clear_segdata(struct segmentation *seg,
68
SEG_LVL_FEATURES feature_id);
70
void vp9_set_segdata(struct segmentation *seg,
72
SEG_LVL_FEATURES feature_id,
75
int vp9_get_segdata(const struct segmentation *seg,
77
SEG_LVL_FEATURES feature_id);
79
extern const vp9_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)];
81
#endif // VP9_COMMON_VP9_SEG_COMMON_H_