media/libvpx/vp9/common/vp9_seg_common.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/libvpx/vp9/common/vp9_seg_common.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,82 @@
     1.4 +/*
     1.5 + *  Copyright (c) 2012 The WebM project authors. All Rights Reserved.
     1.6 + *
     1.7 + *  Use of this source code is governed by a BSD-style license
     1.8 + *  that can be found in the LICENSE file in the root of the source
     1.9 + *  tree. An additional intellectual property rights grant can be found
    1.10 + *  in the file PATENTS.  All contributing project authors may
    1.11 + *  be found in the AUTHORS file in the root of the source tree.
    1.12 + */
    1.13 +
    1.14 +#ifndef VP9_COMMON_VP9_SEG_COMMON_H_
    1.15 +#define VP9_COMMON_VP9_SEG_COMMON_H_
    1.16 +
    1.17 +#include "vp9/common/vp9_treecoder.h"
    1.18 +
    1.19 +#define SEGMENT_DELTADATA   0
    1.20 +#define SEGMENT_ABSDATA     1
    1.21 +
    1.22 +#define MAX_SEGMENTS     8
    1.23 +#define SEG_TREE_PROBS   (MAX_SEGMENTS-1)
    1.24 +
    1.25 +#define PREDICTION_PROBS 3
    1.26 +
    1.27 +// Segment level features.
    1.28 +typedef enum {
    1.29 +  SEG_LVL_ALT_Q = 0,               // Use alternate Quantizer ....
    1.30 +  SEG_LVL_ALT_LF = 1,              // Use alternate loop filter value...
    1.31 +  SEG_LVL_REF_FRAME = 2,           // Optional Segment reference frame
    1.32 +  SEG_LVL_SKIP = 3,                // Optional Segment (0,0) + skip mode
    1.33 +  SEG_LVL_MAX = 4                  // Number of features supported
    1.34 +} SEG_LVL_FEATURES;
    1.35 +
    1.36 +
    1.37 +struct segmentation {
    1.38 +  uint8_t enabled;
    1.39 +  uint8_t update_map;
    1.40 +  uint8_t update_data;
    1.41 +  uint8_t abs_delta;
    1.42 +  uint8_t temporal_update;
    1.43 +
    1.44 +  vp9_prob tree_probs[SEG_TREE_PROBS];
    1.45 +  vp9_prob pred_probs[PREDICTION_PROBS];
    1.46 +
    1.47 +  int16_t feature_data[MAX_SEGMENTS][SEG_LVL_MAX];
    1.48 +  unsigned int feature_mask[MAX_SEGMENTS];
    1.49 +};
    1.50 +
    1.51 +int vp9_segfeature_active(const struct segmentation *seg,
    1.52 +                          int segment_id,
    1.53 +                          SEG_LVL_FEATURES feature_id);
    1.54 +
    1.55 +void vp9_clearall_segfeatures(struct segmentation *seg);
    1.56 +
    1.57 +void vp9_enable_segfeature(struct segmentation *seg,
    1.58 +                           int segment_id,
    1.59 +                           SEG_LVL_FEATURES feature_id);
    1.60 +
    1.61 +void vp9_disable_segfeature(struct segmentation *seg,
    1.62 +                            int segment_id,
    1.63 +                            SEG_LVL_FEATURES feature_id);
    1.64 +
    1.65 +int vp9_seg_feature_data_max(SEG_LVL_FEATURES feature_id);
    1.66 +
    1.67 +int vp9_is_segfeature_signed(SEG_LVL_FEATURES feature_id);
    1.68 +
    1.69 +void vp9_clear_segdata(struct segmentation *seg,
    1.70 +                       int segment_id,
    1.71 +                       SEG_LVL_FEATURES feature_id);
    1.72 +
    1.73 +void vp9_set_segdata(struct segmentation *seg,
    1.74 +                     int segment_id,
    1.75 +                     SEG_LVL_FEATURES feature_id,
    1.76 +                     int seg_data);
    1.77 +
    1.78 +int vp9_get_segdata(const struct segmentation *seg,
    1.79 +                    int segment_id,
    1.80 +                    SEG_LVL_FEATURES feature_id);
    1.81 +
    1.82 +extern const vp9_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)];
    1.83 +
    1.84 +#endif  // VP9_COMMON_VP9_SEG_COMMON_H_
    1.85 +

mercurial