Coverage Report

Created: 2025-06-22 08:04

/src/aom/av1/encoder/segmentation.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (c) 2016, Alliance for Open Media. All rights reserved.
3
 *
4
 * This source code is subject to the terms of the BSD 2 Clause License and
5
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6
 * was not distributed with this source code in the LICENSE file, you can
7
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8
 * Media Patent License 1.0 was not distributed with this source code in the
9
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10
 */
11
12
#include <limits.h>
13
14
#include "aom_mem/aom_mem.h"
15
16
#include "av1/common/pred_common.h"
17
#include "av1/common/tile_common.h"
18
19
#include "av1/encoder/cost.h"
20
#include "av1/encoder/segmentation.h"
21
22
0
void av1_enable_segmentation(struct segmentation *seg) {
23
0
  seg->enabled = 1;
24
0
  seg->update_map = 1;
25
0
  seg->update_data = 1;
26
0
  seg->temporal_update = 0;
27
0
}
28
29
0
void av1_disable_segmentation(struct segmentation *seg) {
30
0
  seg->enabled = 0;
31
0
  seg->update_map = 0;
32
0
  seg->update_data = 0;
33
0
  seg->temporal_update = 0;
34
0
}
35
36
void av1_disable_segfeature(struct segmentation *seg, int segment_id,
37
0
                            SEG_LVL_FEATURES feature_id) {
38
0
  seg->feature_mask[segment_id] &= ~(1u << feature_id);
39
0
}
40
41
void av1_clear_segdata(struct segmentation *seg, int segment_id,
42
0
                       SEG_LVL_FEATURES feature_id) {
43
0
  seg->feature_data[segment_id][feature_id] = 0;
44
0
}
45
46
0
void av1_reset_segment_features(AV1_COMMON *cm) {
47
0
  struct segmentation *seg = &cm->seg;
48
49
  // Set up default state for MB feature flags
50
0
  seg->enabled = 0;
51
0
  seg->update_map = 0;
52
0
  seg->update_data = 0;
53
0
  av1_clearall_segfeatures(seg);
54
0
}