michael@0: /* michael@0: * Copyright (c) 2012 The WebM project authors. All Rights Reserved. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license michael@0: * that can be found in the LICENSE file in the root of the source michael@0: * tree. An additional intellectual property rights grant can be found michael@0: * in the file PATENTS. All contributing project authors may michael@0: * be found in the AUTHORS file in the root of the source tree. michael@0: */ michael@0: michael@0: #ifndef VP9_COMMON_VP9_SEG_COMMON_H_ michael@0: #define VP9_COMMON_VP9_SEG_COMMON_H_ michael@0: michael@0: #include "vp9/common/vp9_treecoder.h" michael@0: michael@0: #define SEGMENT_DELTADATA 0 michael@0: #define SEGMENT_ABSDATA 1 michael@0: michael@0: #define MAX_SEGMENTS 8 michael@0: #define SEG_TREE_PROBS (MAX_SEGMENTS-1) michael@0: michael@0: #define PREDICTION_PROBS 3 michael@0: michael@0: // Segment level features. michael@0: typedef enum { michael@0: SEG_LVL_ALT_Q = 0, // Use alternate Quantizer .... michael@0: SEG_LVL_ALT_LF = 1, // Use alternate loop filter value... michael@0: SEG_LVL_REF_FRAME = 2, // Optional Segment reference frame michael@0: SEG_LVL_SKIP = 3, // Optional Segment (0,0) + skip mode michael@0: SEG_LVL_MAX = 4 // Number of features supported michael@0: } SEG_LVL_FEATURES; michael@0: michael@0: michael@0: struct segmentation { michael@0: uint8_t enabled; michael@0: uint8_t update_map; michael@0: uint8_t update_data; michael@0: uint8_t abs_delta; michael@0: uint8_t temporal_update; michael@0: michael@0: vp9_prob tree_probs[SEG_TREE_PROBS]; michael@0: vp9_prob pred_probs[PREDICTION_PROBS]; michael@0: michael@0: int16_t feature_data[MAX_SEGMENTS][SEG_LVL_MAX]; michael@0: unsigned int feature_mask[MAX_SEGMENTS]; michael@0: }; michael@0: michael@0: int vp9_segfeature_active(const struct segmentation *seg, michael@0: int segment_id, michael@0: SEG_LVL_FEATURES feature_id); michael@0: michael@0: void vp9_clearall_segfeatures(struct segmentation *seg); michael@0: michael@0: void vp9_enable_segfeature(struct segmentation *seg, michael@0: int segment_id, michael@0: SEG_LVL_FEATURES feature_id); michael@0: michael@0: void vp9_disable_segfeature(struct segmentation *seg, michael@0: int segment_id, michael@0: SEG_LVL_FEATURES feature_id); michael@0: michael@0: int vp9_seg_feature_data_max(SEG_LVL_FEATURES feature_id); michael@0: michael@0: int vp9_is_segfeature_signed(SEG_LVL_FEATURES feature_id); michael@0: michael@0: void vp9_clear_segdata(struct segmentation *seg, michael@0: int segment_id, michael@0: SEG_LVL_FEATURES feature_id); michael@0: michael@0: void vp9_set_segdata(struct segmentation *seg, michael@0: int segment_id, michael@0: SEG_LVL_FEATURES feature_id, michael@0: int seg_data); michael@0: michael@0: int vp9_get_segdata(const struct segmentation *seg, michael@0: int segment_id, michael@0: SEG_LVL_FEATURES feature_id); michael@0: michael@0: extern const vp9_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)]; michael@0: michael@0: #endif // VP9_COMMON_VP9_SEG_COMMON_H_ michael@0: