Coverage Report

Created: 2025-08-28 07:12

/src/libvpx/vp8/encoder/modecosts.c
Line
Count
Source
1
/*
2
 *  Copyright (c) 2010 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
#include "vp8/common/blockd.h"
12
#include "modecosts.h"
13
#include "onyx_int.h"
14
#include "treewriter.h"
15
#include "vp8/common/entropymode.h"
16
17
114k
void vp8_init_mode_costs(VP8_COMP *c) {
18
114k
  VP8_COMMON *x = &c->common;
19
114k
  struct rd_costs_struct *rd_costs = &c->rd_costs;
20
21
114k
  {
22
114k
    const vp8_tree_p T = vp8_bmode_tree;
23
24
114k
    int i = 0;
25
26
1.14M
    do {
27
1.14M
      int j = 0;
28
29
11.4M
      do {
30
11.4M
        vp8_cost_tokens(rd_costs->bmode_costs[i][j], vp8_kf_bmode_prob[i][j],
31
11.4M
                        T);
32
11.4M
      } while (++j < VP8_BINTRAMODES);
33
1.14M
    } while (++i < VP8_BINTRAMODES);
34
35
114k
    vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.bmode_prob, T);
36
114k
  }
37
114k
  vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.sub_mv_ref_prob,
38
114k
                  vp8_sub_mv_ref_tree);
39
40
114k
  vp8_cost_tokens(rd_costs->mbmode_cost[1], x->fc.ymode_prob, vp8_ymode_tree);
41
114k
  vp8_cost_tokens(rd_costs->mbmode_cost[0], vp8_kf_ymode_prob,
42
114k
                  vp8_kf_ymode_tree);
43
44
114k
  vp8_cost_tokens(rd_costs->intra_uv_mode_cost[1], x->fc.uv_mode_prob,
45
114k
                  vp8_uv_mode_tree);
46
114k
  vp8_cost_tokens(rd_costs->intra_uv_mode_cost[0], vp8_kf_uv_mode_prob,
47
114k
                  vp8_uv_mode_tree);
48
114k
}