Coverage Report

Created: 2025-08-26 07:00

/src/libvpx/vp9/common/vp9_scale.h
Line
Count
Source
1
/*
2
 *  Copyright (c) 2013 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_SCALE_H_
12
#define VPX_VP9_COMMON_VP9_SCALE_H_
13
14
#include "vp9/common/vp9_mv.h"
15
#include "vpx_dsp/vpx_convolve.h"
16
17
#ifdef __cplusplus
18
extern "C" {
19
#endif
20
21
137M
#define REF_SCALE_SHIFT 14
22
40.0M
#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
23
85.7M
#define REF_INVALID_SCALE (-1)
24
25
struct scale_factors {
26
  int x_scale_fp;  // horizontal fixed point scale factor
27
  int y_scale_fp;  // vertical fixed point scale factor
28
  int x_step_q4;
29
  int y_step_q4;
30
31
  int (*scale_value_x)(int val, const struct scale_factors *sf);
32
  int (*scale_value_y)(int val, const struct scale_factors *sf);
33
34
  convolve_fn_t predict[2][2][2];  // horiz, vert, avg
35
#if CONFIG_VP9_HIGHBITDEPTH
36
  highbd_convolve_fn_t highbd_predict[2][2][2];  // horiz, vert, avg
37
#endif
38
};
39
40
MV32 vp9_scale_mv(const MV *mv, int x, int y, const struct scale_factors *sf);
41
42
#if CONFIG_VP9_HIGHBITDEPTH
43
void vp9_setup_scale_factors_for_frame(struct scale_factors *sf, int other_w,
44
                                       int other_h, int this_w, int this_h,
45
                                       int use_highbd);
46
#else
47
void vp9_setup_scale_factors_for_frame(struct scale_factors *sf, int other_w,
48
                                       int other_h, int this_w, int this_h);
49
#endif
50
51
28.5M
static INLINE int vp9_is_valid_scale(const struct scale_factors *sf) {
52
28.5M
  return sf->x_scale_fp != REF_INVALID_SCALE &&
53
28.5M
         sf->y_scale_fp != REF_INVALID_SCALE;
54
28.5M
}
Unexecuted instantiation: vp9_dx_iface.c:vp9_is_valid_scale
vp9_decodeframe.c:vp9_is_valid_scale
Line
Count
Source
51
28.3M
static INLINE int vp9_is_valid_scale(const struct scale_factors *sf) {
52
28.3M
  return sf->x_scale_fp != REF_INVALID_SCALE &&
53
28.3M
         sf->y_scale_fp != REF_INVALID_SCALE;
54
28.3M
}
Unexecuted instantiation: vp9_detokenize.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_decoder.c:vp9_is_valid_scale
Unexecuted instantiation: yv12config.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_alloccommon.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_blockd.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_entropy.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_entropymode.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_entropymv.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_idct.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_pred_common.c:vp9_is_valid_scale
vp9_scale.c:vp9_is_valid_scale
Line
Count
Source
51
209k
static INLINE int vp9_is_valid_scale(const struct scale_factors *sf) {
52
209k
  return sf->x_scale_fp != REF_INVALID_SCALE &&
53
209k
         sf->y_scale_fp != REF_INVALID_SCALE;
54
209k
}
Unexecuted instantiation: vp9_seg_common.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_tile_common.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_loopfilter.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_thread_common.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_reconinter.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_reconintra.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_scan.c:vp9_is_valid_scale
Unexecuted instantiation: vp9_decodemv.c:vp9_is_valid_scale
55
56
14.3M
static INLINE int vp9_is_scaled(const struct scale_factors *sf) {
57
14.3M
  return vp9_is_valid_scale(sf) &&
58
14.4M
         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
59
14.3M
}
Unexecuted instantiation: vp9_dx_iface.c:vp9_is_scaled
vp9_decodeframe.c:vp9_is_scaled
Line
Count
Source
56
14.1M
static INLINE int vp9_is_scaled(const struct scale_factors *sf) {
57
14.1M
  return vp9_is_valid_scale(sf) &&
58
14.1M
         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
59
14.1M
}
Unexecuted instantiation: vp9_detokenize.c:vp9_is_scaled
Unexecuted instantiation: vp9_decoder.c:vp9_is_scaled
Unexecuted instantiation: yv12config.c:vp9_is_scaled
Unexecuted instantiation: vp9_alloccommon.c:vp9_is_scaled
Unexecuted instantiation: vp9_blockd.c:vp9_is_scaled
Unexecuted instantiation: vp9_entropy.c:vp9_is_scaled
Unexecuted instantiation: vp9_entropymode.c:vp9_is_scaled
Unexecuted instantiation: vp9_entropymv.c:vp9_is_scaled
Unexecuted instantiation: vp9_idct.c:vp9_is_scaled
Unexecuted instantiation: vp9_pred_common.c:vp9_is_scaled
vp9_scale.c:vp9_is_scaled
Line
Count
Source
56
209k
static INLINE int vp9_is_scaled(const struct scale_factors *sf) {
57
209k
  return vp9_is_valid_scale(sf) &&
58
209k
         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
59
209k
}
Unexecuted instantiation: vp9_seg_common.c:vp9_is_scaled
Unexecuted instantiation: vp9_tile_common.c:vp9_is_scaled
Unexecuted instantiation: vp9_loopfilter.c:vp9_is_scaled
Unexecuted instantiation: vp9_thread_common.c:vp9_is_scaled
Unexecuted instantiation: vp9_reconinter.c:vp9_is_scaled
Unexecuted instantiation: vp9_reconintra.c:vp9_is_scaled
Unexecuted instantiation: vp9_scan.c:vp9_is_scaled
Unexecuted instantiation: vp9_decodemv.c:vp9_is_scaled
60
61
static INLINE int valid_ref_frame_size(int ref_width, int ref_height,
62
432k
                                       int this_width, int this_height) {
63
432k
  return 2 * this_width >= ref_width && 2 * this_height >= ref_height &&
64
432k
         this_width <= 16 * ref_width && this_height <= 16 * ref_height;
65
432k
}
Unexecuted instantiation: vp9_dx_iface.c:valid_ref_frame_size
vp9_decodeframe.c:valid_ref_frame_size
Line
Count
Source
62
217k
                                       int this_width, int this_height) {
63
217k
  return 2 * this_width >= ref_width && 2 * this_height >= ref_height &&
64
217k
         this_width <= 16 * ref_width && this_height <= 16 * ref_height;
65
217k
}
Unexecuted instantiation: vp9_detokenize.c:valid_ref_frame_size
Unexecuted instantiation: vp9_decoder.c:valid_ref_frame_size
Unexecuted instantiation: yv12config.c:valid_ref_frame_size
Unexecuted instantiation: vp9_alloccommon.c:valid_ref_frame_size
Unexecuted instantiation: vp9_blockd.c:valid_ref_frame_size
Unexecuted instantiation: vp9_entropy.c:valid_ref_frame_size
Unexecuted instantiation: vp9_entropymode.c:valid_ref_frame_size
Unexecuted instantiation: vp9_entropymv.c:valid_ref_frame_size
Unexecuted instantiation: vp9_idct.c:valid_ref_frame_size
Unexecuted instantiation: vp9_pred_common.c:valid_ref_frame_size
vp9_scale.c:valid_ref_frame_size
Line
Count
Source
62
215k
                                       int this_width, int this_height) {
63
215k
  return 2 * this_width >= ref_width && 2 * this_height >= ref_height &&
64
215k
         this_width <= 16 * ref_width && this_height <= 16 * ref_height;
65
215k
}
Unexecuted instantiation: vp9_seg_common.c:valid_ref_frame_size
Unexecuted instantiation: vp9_tile_common.c:valid_ref_frame_size
Unexecuted instantiation: vp9_loopfilter.c:valid_ref_frame_size
Unexecuted instantiation: vp9_thread_common.c:valid_ref_frame_size
Unexecuted instantiation: vp9_reconinter.c:valid_ref_frame_size
Unexecuted instantiation: vp9_reconintra.c:valid_ref_frame_size
Unexecuted instantiation: vp9_scan.c:valid_ref_frame_size
Unexecuted instantiation: vp9_decodemv.c:valid_ref_frame_size
66
67
#ifdef __cplusplus
68
}  // extern "C"
69
#endif
70
71
#endif  // VPX_VP9_COMMON_VP9_SCALE_H_