/src/libvpx/vp9/common/vp9_seg_common.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
3 | | * |
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. |
9 | | */ |
10 | | |
11 | | #ifndef VPX_VP9_COMMON_VP9_SEG_COMMON_H_ |
12 | | #define VPX_VP9_COMMON_VP9_SEG_COMMON_H_ |
13 | | |
14 | | #include "vpx_dsp/prob.h" |
15 | | |
16 | | #ifdef __cplusplus |
17 | | extern "C" { |
18 | | #endif |
19 | | |
20 | 7.75k | #define SEGMENT_DELTADATA 0 |
21 | 0 | #define SEGMENT_ABSDATA 1 |
22 | | |
23 | 2.74M | #define MAX_SEGMENTS 8 |
24 | 0 | #define SEG_TREE_PROBS (MAX_SEGMENTS - 1) |
25 | | |
26 | 0 | #define PREDICTION_PROBS 3 |
27 | | |
28 | | // Segment ID used to skip background encoding |
29 | 0 | #define BACKGROUND_SEG_SKIP_ID 3 |
30 | | // Number of frames that don't skip after a key frame |
31 | 0 | #define FRAMES_NO_SKIPPING_AFTER_KEY 20 |
32 | | |
33 | | // Segment level features. |
34 | | typedef enum { |
35 | | SEG_LVL_ALT_Q = 0, // Use alternate Quantizer .... |
36 | | SEG_LVL_ALT_LF = 1, // Use alternate loop filter value... |
37 | | SEG_LVL_REF_FRAME = 2, // Optional Segment reference frame |
38 | | SEG_LVL_SKIP = 3, // Optional Segment (0,0) + skip mode |
39 | | SEG_LVL_MAX = 4 // Number of features supported |
40 | | } SEG_LVL_FEATURES; |
41 | | |
42 | | struct segmentation { |
43 | | uint8_t enabled; |
44 | | uint8_t update_map; |
45 | | uint8_t update_data; |
46 | | uint8_t abs_delta; |
47 | | uint8_t temporal_update; |
48 | | |
49 | | vpx_prob tree_probs[SEG_TREE_PROBS]; |
50 | | vpx_prob pred_probs[PREDICTION_PROBS]; |
51 | | |
52 | | int16_t feature_data[MAX_SEGMENTS][SEG_LVL_MAX]; |
53 | | uint32_t feature_mask[MAX_SEGMENTS]; |
54 | | int aq_av_offset; |
55 | | }; |
56 | | |
57 | | static INLINE int segfeature_active(const struct segmentation *seg, |
58 | | int segment_id, |
59 | 72.7M | SEG_LVL_FEATURES feature_id) { |
60 | 72.7M | return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id)); |
61 | 72.7M | } Unexecuted instantiation: vp9_cx_iface.c:segfeature_active Unexecuted instantiation: vp9_firstpass.c:segfeature_active Unexecuted instantiation: vp9_mcomp.c:segfeature_active Unexecuted instantiation: vp9_encoder.c:segfeature_active Unexecuted instantiation: vp9_picklpf.c:segfeature_active vp9_quantize.c:segfeature_active Line | Count | Source | 59 | 8.89M | SEG_LVL_FEATURES feature_id) { | 60 | 8.89M | return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id)); | 61 | 8.89M | } |
Unexecuted instantiation: vp9_ratectrl.c:segfeature_active Unexecuted instantiation: vp9_rd.c:segfeature_active Unexecuted instantiation: vp9_segmentation.c:segfeature_active Unexecuted instantiation: vp9_speed_features.c:segfeature_active Unexecuted instantiation: vp9_svc_layercontext.c:segfeature_active Unexecuted instantiation: vp9_tokenize.c:segfeature_active Unexecuted instantiation: vp9_aq_variance.c:segfeature_active Unexecuted instantiation: vp9_aq_360.c:segfeature_active Unexecuted instantiation: vp9_aq_cyclicrefresh.c:segfeature_active Unexecuted instantiation: vp9_aq_complexity.c:segfeature_active Unexecuted instantiation: vp9_alt_ref_aq.c:segfeature_active Unexecuted instantiation: vp9_skin_detection.c:segfeature_active Unexecuted instantiation: vp9_noise_estimate.c:segfeature_active Unexecuted instantiation: vp9_ext_ratectrl.c:segfeature_active Unexecuted instantiation: vp9_temporal_filter.c:segfeature_active Unexecuted instantiation: vp9_tpl_model.c:segfeature_active Unexecuted instantiation: vp9_mbgraph.c:segfeature_active Unexecuted instantiation: yv12config.c:segfeature_active Unexecuted instantiation: vp9_alloccommon.c:segfeature_active Unexecuted instantiation: vp9_blockd.c:segfeature_active Unexecuted instantiation: vp9_entropy.c:segfeature_active Unexecuted instantiation: vp9_entropymode.c:segfeature_active Unexecuted instantiation: vp9_entropymv.c:segfeature_active Unexecuted instantiation: vp9_idct.c:segfeature_active Unexecuted instantiation: vp9_seg_common.c:segfeature_active Unexecuted instantiation: vp9_tile_common.c:segfeature_active vp9_loopfilter.c:segfeature_active Line | Count | Source | 59 | 1.89M | SEG_LVL_FEATURES feature_id) { | 60 | 1.89M | return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id)); | 61 | 1.89M | } |
Unexecuted instantiation: vp9_thread_common.c:segfeature_active vp9_quant_common.c:segfeature_active Line | Count | Source | 59 | 9.23M | SEG_LVL_FEATURES feature_id) { | 60 | 9.23M | return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id)); | 61 | 9.23M | } |
Unexecuted instantiation: vp9_reconinter.c:segfeature_active Unexecuted instantiation: vp9_reconintra.c:segfeature_active Unexecuted instantiation: vp9_scan.c:segfeature_active vp9_bitstream.c:segfeature_active Line | Count | Source | 59 | 4.45M | SEG_LVL_FEATURES feature_id) { | 60 | 4.45M | return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id)); | 61 | 4.45M | } |
Unexecuted instantiation: vp9_context_tree.c:segfeature_active Unexecuted instantiation: vp9_dct.c:segfeature_active vp9_encodeframe.c:segfeature_active Line | Count | Source | 59 | 12.7M | SEG_LVL_FEATURES feature_id) { | 60 | 12.7M | return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id)); | 61 | 12.7M | } |
Unexecuted instantiation: vp9_encodemb.c:segfeature_active Unexecuted instantiation: vp9_encodemv.c:segfeature_active Unexecuted instantiation: vp9_ethread.c:segfeature_active Unexecuted instantiation: vp9_frame_scale.c:segfeature_active Unexecuted instantiation: vp9_lookahead.c:segfeature_active Unexecuted instantiation: vp9_multi_thread.c:segfeature_active vp9_rdopt.c:segfeature_active Line | Count | Source | 59 | 35.4M | SEG_LVL_FEATURES feature_id) { | 60 | 35.4M | return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id)); | 61 | 35.4M | } |
Unexecuted instantiation: vp9_pickmode.c:segfeature_active Unexecuted instantiation: temporal_filter_sse4.c:segfeature_active Unexecuted instantiation: vp9_quantize_sse2.c:segfeature_active Unexecuted instantiation: vp9_quantize_ssse3.c:segfeature_active Unexecuted instantiation: vp9_quantize_avx2.c:segfeature_active Unexecuted instantiation: highbd_temporal_filter_sse4.c:segfeature_active Unexecuted instantiation: quantize.c:segfeature_active Unexecuted instantiation: quantize_sse2.c:segfeature_active Unexecuted instantiation: quantize_ssse3.c:segfeature_active Unexecuted instantiation: quantize_avx.c:segfeature_active Unexecuted instantiation: quantize_avx2.c:segfeature_active Unexecuted instantiation: highbd_quantize_intrin_sse2.c:segfeature_active Unexecuted instantiation: highbd_quantize_intrin_avx2.c:segfeature_active Unexecuted instantiation: vp9_pred_common.c:segfeature_active Unexecuted instantiation: vp9_mvref_common.c:segfeature_active |
62 | | |
63 | | void vp9_clearall_segfeatures(struct segmentation *seg); |
64 | | |
65 | | void vp9_enable_segfeature(struct segmentation *seg, int segment_id, |
66 | | SEG_LVL_FEATURES feature_id); |
67 | | |
68 | | int vp9_seg_feature_data_max(SEG_LVL_FEATURES feature_id); |
69 | | |
70 | | int vp9_is_segfeature_signed(SEG_LVL_FEATURES feature_id); |
71 | | |
72 | | void vp9_set_segdata(struct segmentation *seg, int segment_id, |
73 | | SEG_LVL_FEATURES feature_id, int seg_data); |
74 | | |
75 | | static INLINE int get_segdata(const struct segmentation *seg, int segment_id, |
76 | 0 | SEG_LVL_FEATURES feature_id) { |
77 | 0 | return seg->feature_data[segment_id][feature_id]; |
78 | 0 | } Unexecuted instantiation: vp9_cx_iface.c:get_segdata Unexecuted instantiation: vp9_firstpass.c:get_segdata Unexecuted instantiation: vp9_mcomp.c:get_segdata Unexecuted instantiation: vp9_encoder.c:get_segdata Unexecuted instantiation: vp9_picklpf.c:get_segdata Unexecuted instantiation: vp9_quantize.c:get_segdata Unexecuted instantiation: vp9_ratectrl.c:get_segdata Unexecuted instantiation: vp9_rd.c:get_segdata Unexecuted instantiation: vp9_segmentation.c:get_segdata Unexecuted instantiation: vp9_speed_features.c:get_segdata Unexecuted instantiation: vp9_svc_layercontext.c:get_segdata Unexecuted instantiation: vp9_tokenize.c:get_segdata Unexecuted instantiation: vp9_aq_variance.c:get_segdata Unexecuted instantiation: vp9_aq_360.c:get_segdata Unexecuted instantiation: vp9_aq_cyclicrefresh.c:get_segdata Unexecuted instantiation: vp9_aq_complexity.c:get_segdata Unexecuted instantiation: vp9_alt_ref_aq.c:get_segdata Unexecuted instantiation: vp9_skin_detection.c:get_segdata Unexecuted instantiation: vp9_noise_estimate.c:get_segdata Unexecuted instantiation: vp9_ext_ratectrl.c:get_segdata Unexecuted instantiation: vp9_temporal_filter.c:get_segdata Unexecuted instantiation: vp9_tpl_model.c:get_segdata Unexecuted instantiation: vp9_mbgraph.c:get_segdata Unexecuted instantiation: yv12config.c:get_segdata Unexecuted instantiation: vp9_alloccommon.c:get_segdata Unexecuted instantiation: vp9_blockd.c:get_segdata Unexecuted instantiation: vp9_entropy.c:get_segdata Unexecuted instantiation: vp9_entropymode.c:get_segdata Unexecuted instantiation: vp9_entropymv.c:get_segdata Unexecuted instantiation: vp9_idct.c:get_segdata Unexecuted instantiation: vp9_seg_common.c:get_segdata Unexecuted instantiation: vp9_tile_common.c:get_segdata Unexecuted instantiation: vp9_loopfilter.c:get_segdata Unexecuted instantiation: vp9_thread_common.c:get_segdata Unexecuted instantiation: vp9_quant_common.c:get_segdata Unexecuted instantiation: vp9_reconinter.c:get_segdata Unexecuted instantiation: vp9_reconintra.c:get_segdata Unexecuted instantiation: vp9_scan.c:get_segdata Unexecuted instantiation: vp9_bitstream.c:get_segdata Unexecuted instantiation: vp9_context_tree.c:get_segdata Unexecuted instantiation: vp9_dct.c:get_segdata Unexecuted instantiation: vp9_encodeframe.c:get_segdata Unexecuted instantiation: vp9_encodemb.c:get_segdata Unexecuted instantiation: vp9_encodemv.c:get_segdata Unexecuted instantiation: vp9_ethread.c:get_segdata Unexecuted instantiation: vp9_frame_scale.c:get_segdata Unexecuted instantiation: vp9_lookahead.c:get_segdata Unexecuted instantiation: vp9_multi_thread.c:get_segdata Unexecuted instantiation: vp9_rdopt.c:get_segdata Unexecuted instantiation: vp9_pickmode.c:get_segdata Unexecuted instantiation: temporal_filter_sse4.c:get_segdata Unexecuted instantiation: vp9_quantize_sse2.c:get_segdata Unexecuted instantiation: vp9_quantize_ssse3.c:get_segdata Unexecuted instantiation: vp9_quantize_avx2.c:get_segdata Unexecuted instantiation: highbd_temporal_filter_sse4.c:get_segdata Unexecuted instantiation: quantize.c:get_segdata Unexecuted instantiation: quantize_sse2.c:get_segdata Unexecuted instantiation: quantize_ssse3.c:get_segdata Unexecuted instantiation: quantize_avx.c:get_segdata Unexecuted instantiation: quantize_avx2.c:get_segdata Unexecuted instantiation: highbd_quantize_intrin_sse2.c:get_segdata Unexecuted instantiation: highbd_quantize_intrin_avx2.c:get_segdata Unexecuted instantiation: vp9_pred_common.c:get_segdata Unexecuted instantiation: vp9_mvref_common.c:get_segdata |
79 | | |
80 | | extern const vpx_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)]; |
81 | | |
82 | | #ifdef __cplusplus |
83 | | } // extern "C" |
84 | | #endif |
85 | | |
86 | | #endif // VPX_VP9_COMMON_VP9_SEG_COMMON_H_ |