Coverage Report

Created: 2022-08-24 06:17

/src/aom/av1/common/resize.h
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
#ifndef AOM_AV1_COMMON_RESIZE_H_
13
#define AOM_AV1_COMMON_RESIZE_H_
14
15
#include <stdio.h>
16
#include "aom/aom_integer.h"
17
#include "av1/common/av1_common_int.h"
18
19
#ifdef __cplusplus
20
extern "C" {
21
#endif
22
23
void av1_resize_plane(const uint8_t *const input, int height, int width,
24
                      int in_stride, uint8_t *output, int height2, int width2,
25
                      int out_stride);
26
void av1_upscale_plane_double_prec(const double *const input, int height,
27
                                   int width, int in_stride, double *output,
28
                                   int height2, int width2, int out_stride);
29
void av1_resize_frame420(const uint8_t *const y, int y_stride,
30
                         const uint8_t *const u, const uint8_t *const v,
31
                         int uv_stride, int height, int width, uint8_t *oy,
32
                         int oy_stride, uint8_t *ou, uint8_t *ov,
33
                         int ouv_stride, int oheight, int owidth);
34
void av1_resize_frame422(const uint8_t *const y, int y_stride,
35
                         const uint8_t *const u, const uint8_t *const v,
36
                         int uv_stride, int height, int width, uint8_t *oy,
37
                         int oy_stride, uint8_t *ou, uint8_t *ov,
38
                         int ouv_stride, int oheight, int owidth);
39
void av1_resize_frame444(const uint8_t *const y, int y_stride,
40
                         const uint8_t *const u, const uint8_t *const v,
41
                         int uv_stride, int height, int width, uint8_t *oy,
42
                         int oy_stride, uint8_t *ou, uint8_t *ov,
43
                         int ouv_stride, int oheight, int owidth);
44
45
void av1_highbd_resize_plane(const uint8_t *const input, int height, int width,
46
                             int in_stride, uint8_t *output, int height2,
47
                             int width2, int out_stride, int bd);
48
void av1_highbd_resize_frame420(const uint8_t *const y, int y_stride,
49
                                const uint8_t *const u, const uint8_t *const v,
50
                                int uv_stride, int height, int width,
51
                                uint8_t *oy, int oy_stride, uint8_t *ou,
52
                                uint8_t *ov, int ouv_stride, int oheight,
53
                                int owidth, int bd);
54
void av1_highbd_resize_frame422(const uint8_t *const y, int y_stride,
55
                                const uint8_t *const u, const uint8_t *const v,
56
                                int uv_stride, int height, int width,
57
                                uint8_t *oy, int oy_stride, uint8_t *ou,
58
                                uint8_t *ov, int ouv_stride, int oheight,
59
                                int owidth, int bd);
60
void av1_highbd_resize_frame444(const uint8_t *const y, int y_stride,
61
                                const uint8_t *const u, const uint8_t *const v,
62
                                int uv_stride, int height, int width,
63
                                uint8_t *oy, int oy_stride, uint8_t *ou,
64
                                uint8_t *ov, int ouv_stride, int oheight,
65
                                int owidth, int bd);
66
67
void av1_upscale_normative_rows(const AV1_COMMON *cm, const uint8_t *src,
68
                                int src_stride, uint8_t *dst, int dst_stride,
69
                                int plane, int rows);
70
void av1_upscale_normative_and_extend_frame(const AV1_COMMON *cm,
71
                                            const YV12_BUFFER_CONFIG *src,
72
                                            YV12_BUFFER_CONFIG *dst);
73
74
YV12_BUFFER_CONFIG *av1_realloc_and_scale_if_required(
75
    AV1_COMMON *cm, YV12_BUFFER_CONFIG *unscaled, YV12_BUFFER_CONFIG *scaled,
76
    const InterpFilter filter, const int phase, const bool use_optimized_scaler,
77
    const bool for_psnr, const int border_in_pixels,
78
    const bool alloc_y_buffer_8bit);
79
80
void av1_resize_and_extend_frame_nonnormative(const YV12_BUFFER_CONFIG *src,
81
                                              YV12_BUFFER_CONFIG *dst, int bd,
82
                                              const int num_planes);
83
84
// Calculates the scaled dimensions from the given original dimensions and the
85
// resize scale denominator.
86
void av1_calculate_scaled_size(int *width, int *height, int resize_denom);
87
88
// Similar to above, but calculates scaled dimensions after superres from the
89
// given original dimensions and superres scale denominator.
90
void av1_calculate_scaled_superres_size(int *width, int *height,
91
                                        int superres_denom);
92
93
// Inverse of av1_calculate_scaled_superres_size() above: calculates the
94
// original dimensions from the given scaled dimensions and the scale
95
// denominator.
96
void av1_calculate_unscaled_superres_size(int *width, int *height, int denom);
97
98
void av1_superres_upscale(AV1_COMMON *cm, BufferPool *const pool);
99
100
// Returns 1 if a superres upscaled frame is scaled and 0 otherwise.
101
194k
static INLINE int av1_superres_scaled(const AV1_COMMON *cm) {
102
  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
103
  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
104
  // So, the following check is more accurate.
105
194k
  return !(cm->width == cm->superres_upscaled_width);
106
194k
}
decodeframe.c:av1_superres_scaled
Line
Count
Source
101
496
static INLINE int av1_superres_scaled(const AV1_COMMON *cm) {
102
  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
103
  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
104
  // So, the following check is more accurate.
105
496
  return !(cm->width == cm->superres_upscaled_width);
106
496
}
Unexecuted instantiation: av1_cx_iface.c:av1_superres_scaled
Unexecuted instantiation: av1_quantize.c:av1_superres_scaled
Unexecuted instantiation: bitstream.c:av1_superres_scaled
Unexecuted instantiation: encodemv.c:av1_superres_scaled
encoder.c:av1_superres_scaled
Line
Count
Source
101
3.78k
static INLINE int av1_superres_scaled(const AV1_COMMON *cm) {
102
  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
103
  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
104
  // So, the following check is more accurate.
105
3.78k
  return !(cm->width == cm->superres_upscaled_width);
106
3.78k
}
Unexecuted instantiation: encoder_utils.c:av1_superres_scaled
Unexecuted instantiation: encodetxb.c:av1_superres_scaled
Unexecuted instantiation: ethread.c:av1_superres_scaled
Unexecuted instantiation: firstpass.c:av1_superres_scaled
Unexecuted instantiation: global_motion_facade.c:av1_superres_scaled
Unexecuted instantiation: level.c:av1_superres_scaled
Unexecuted instantiation: lookahead.c:av1_superres_scaled
Unexecuted instantiation: mcomp.c:av1_superres_scaled
Unexecuted instantiation: mv_prec.c:av1_superres_scaled
Unexecuted instantiation: palette.c:av1_superres_scaled
Unexecuted instantiation: pass2_strategy.c:av1_superres_scaled
Unexecuted instantiation: pickcdef.c:av1_superres_scaled
Unexecuted instantiation: picklpf.c:av1_superres_scaled
Unexecuted instantiation: pickrst.c:av1_superres_scaled
ratectrl.c:av1_superres_scaled
Line
Count
Source
101
2.52k
static INLINE int av1_superres_scaled(const AV1_COMMON *cm) {
102
  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
103
  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
104
  // So, the following check is more accurate.
105
2.52k
  return !(cm->width == cm->superres_upscaled_width);
106
2.52k
}
Unexecuted instantiation: rd.c:av1_superres_scaled
Unexecuted instantiation: rdopt.c:av1_superres_scaled
Unexecuted instantiation: segmentation.c:av1_superres_scaled
Unexecuted instantiation: speed_features.c:av1_superres_scaled
superres_scale.c:av1_superres_scaled
Line
Count
Source
101
1.26k
static INLINE int av1_superres_scaled(const AV1_COMMON *cm) {
102
  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
103
  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
104
  // So, the following check is more accurate.
105
1.26k
  return !(cm->width == cm->superres_upscaled_width);
106
1.26k
}
Unexecuted instantiation: svc_layercontext.c:av1_superres_scaled
Unexecuted instantiation: temporal_filter.c:av1_superres_scaled
Unexecuted instantiation: thirdpass.c:av1_superres_scaled
Unexecuted instantiation: tokenize.c:av1_superres_scaled
Unexecuted instantiation: tpl_model.c:av1_superres_scaled
Unexecuted instantiation: tx_search.c:av1_superres_scaled
Unexecuted instantiation: txb_rdopt.c:av1_superres_scaled
Unexecuted instantiation: intra_mode_search.c:av1_superres_scaled
Unexecuted instantiation: var_based_part.c:av1_superres_scaled
Unexecuted instantiation: av1_noise_estimate.c:av1_superres_scaled
Unexecuted instantiation: resize.c:av1_superres_scaled
restoration.c:av1_superres_scaled
Line
Count
Source
101
184k
static INLINE int av1_superres_scaled(const AV1_COMMON *cm) {
102
  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
103
  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
104
  // So, the following check is more accurate.
105
184k
  return !(cm->width == cm->superres_upscaled_width);
106
184k
}
tile_common.c:av1_superres_scaled
Line
Count
Source
101
24
static INLINE int av1_superres_scaled(const AV1_COMMON *cm) {
102
  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
103
  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
104
  // So, the following check is more accurate.
105
24
  return !(cm->width == cm->superres_upscaled_width);
106
24
}
Unexecuted instantiation: aq_complexity.c:av1_superres_scaled
Unexecuted instantiation: aq_cyclicrefresh.c:av1_superres_scaled
Unexecuted instantiation: aq_variance.c:av1_superres_scaled
Unexecuted instantiation: allintra_vis.c:av1_superres_scaled
Unexecuted instantiation: compound_type.c:av1_superres_scaled
Unexecuted instantiation: context_tree.c:av1_superres_scaled
encodeframe.c:av1_superres_scaled
Line
Count
Source
101
1.48k
static INLINE int av1_superres_scaled(const AV1_COMMON *cm) {
102
  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
103
  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
104
  // So, the following check is more accurate.
105
1.48k
  return !(cm->width == cm->superres_upscaled_width);
106
1.48k
}
Unexecuted instantiation: encodeframe_utils.c:av1_superres_scaled
Unexecuted instantiation: encodemb.c:av1_superres_scaled
Unexecuted instantiation: encode_strategy.c:av1_superres_scaled
Unexecuted instantiation: global_motion.c:av1_superres_scaled
Unexecuted instantiation: gop_structure.c:av1_superres_scaled
Unexecuted instantiation: interp_search.c:av1_superres_scaled
Unexecuted instantiation: motion_search_facade.c:av1_superres_scaled
Unexecuted instantiation: partition_search.c:av1_superres_scaled
Unexecuted instantiation: partition_strategy.c:av1_superres_scaled
Unexecuted instantiation: nonrd_pickmode.c:av1_superres_scaled
Unexecuted instantiation: convolve.c:av1_superres_scaled
107
108
0
#define UPSCALE_NORMATIVE_TAPS 8
109
extern const int16_t av1_resize_filter_normative[1 << RS_SUBPEL_BITS]
110
                                                [UPSCALE_NORMATIVE_TAPS];
111
112
int32_t av1_get_upscale_convolve_step(int in_length, int out_length);
113
114
#ifdef __cplusplus
115
}  // extern "C"
116
#endif
117
118
#endif  // AOM_AV1_COMMON_RESIZE_H_