Coverage Report

Created: 2024-09-06 07:53

/src/libvpx/vp8/common/mbpitch.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 "blockd.h"
12
13
4.91k
void vp8_setup_block_dptrs(MACROBLOCKD *x) {
14
4.91k
  int r, c;
15
16
24.5k
  for (r = 0; r < 4; ++r) {
17
98.2k
    for (c = 0; c < 4; ++c) {
18
78.6k
      x->block[r * 4 + c].predictor = x->predictor + r * 4 * 16 + c * 4;
19
78.6k
    }
20
19.6k
  }
21
22
14.7k
  for (r = 0; r < 2; ++r) {
23
29.4k
    for (c = 0; c < 2; ++c) {
24
19.6k
      x->block[16 + r * 2 + c].predictor =
25
19.6k
          x->predictor + 256 + r * 4 * 8 + c * 4;
26
19.6k
    }
27
9.82k
  }
28
29
14.7k
  for (r = 0; r < 2; ++r) {
30
29.4k
    for (c = 0; c < 2; ++c) {
31
19.6k
      x->block[20 + r * 2 + c].predictor =
32
19.6k
          x->predictor + 320 + r * 4 * 8 + c * 4;
33
19.6k
    }
34
9.82k
  }
35
36
127k
  for (r = 0; r < 25; ++r) {
37
122k
    x->block[r].qcoeff = x->qcoeff + r * 16;
38
122k
    x->block[r].dqcoeff = x->dqcoeff + r * 16;
39
122k
    x->block[r].eob = x->eobs + r;
40
122k
  }
41
4.91k
}
42
43
88.0k
void vp8_build_block_doffsets(MACROBLOCKD *x) {
44
88.0k
  int block;
45
46
1.49M
  for (block = 0; block < 16; ++block) /* y blocks */
47
1.40M
  {
48
1.40M
    x->block[block].offset =
49
1.40M
        (block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4;
50
1.40M
  }
51
52
440k
  for (block = 16; block < 20; ++block) /* U and V blocks */
53
352k
  {
54
352k
    x->block[block + 4].offset = x->block[block].offset =
55
352k
        ((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4;
56
352k
  }
57
88.0k
}