#include "dc_spl.h"
#include "dc_spl_scl_filters.h"
#include "dc_spl_isharp_filters.h"
#define IDENTITY_RATIO(ratio) …
#define MIN_VIEWPORT_SIZE …
static struct spl_rect intersect_rec(const struct spl_rect *r0, const struct spl_rect *r1)
{ … }
static struct spl_rect shift_rec(const struct spl_rect *rec_in, int x, int y)
{ … }
static struct spl_rect calculate_plane_rec_in_timing_active(
struct spl_in *spl_in,
const struct spl_rect *rec_in)
{ … }
static struct spl_rect calculate_mpc_slice_in_timing_active(
struct spl_in *spl_in,
struct spl_rect *plane_clip_rec)
{ … }
static struct spl_rect calculate_odm_slice_in_timing_active(struct spl_in *spl_in)
{ … }
static void spl_calculate_recout(struct spl_in *spl_in, struct spl_out *spl_out)
{ … }
static void spl_calculate_scaling_ratios(struct spl_in *spl_in, struct spl_out *spl_out)
{ … }
static void spl_calculate_viewport_size(struct spl_in *spl_in, struct spl_out *spl_out)
{ … }
static void spl_get_vp_scan_direction(enum spl_rotation_angle rotation,
bool horizontal_mirror,
bool *orthogonal_rotation,
bool *flip_vert_scan_dir,
bool *flip_horz_scan_dir)
{ … }
static void spl_calculate_init_and_vp(bool flip_scan_dir,
int recout_offset_within_recout_full,
int recout_size,
int src_size,
int taps,
struct fixed31_32 ratio,
struct fixed31_32 init_adj,
struct fixed31_32 *init,
int *vp_offset,
int *vp_size)
{ … }
static bool spl_is_yuv420(enum spl_pixel_format format)
{ … }
static void spl_calculate_inits_and_viewports(struct spl_in *spl_in, struct spl_out *spl_out)
{ … }
static void spl_handle_3d_recout(struct spl_in *spl_in, struct spl_rect *recout)
{ … }
static void spl_clamp_viewport(struct spl_rect *viewport)
{ … }
static bool spl_dscl_is_420_format(enum spl_pixel_format format)
{ … }
static bool spl_dscl_is_video_format(enum spl_pixel_format format)
{ … }
static enum scl_mode spl_get_dscl_mode(const struct spl_in *spl_in,
const struct spl_scaler_data *data)
{ … }
static bool spl_get_optimal_number_of_taps(
int max_downscale_src_width, struct spl_in *spl_in, struct spl_out *spl_out,
const struct spl_taps *in_taps)
{ … }
static void spl_set_black_color_data(enum spl_pixel_format format,
struct scl_black_color *scl_black_color)
{ … }
static void spl_set_manual_ratio_init_data(struct dscl_prog_data *dscl_prog_data,
const struct spl_scaler_data *scl_data)
{ … }
static void spl_set_taps_data(struct dscl_prog_data *dscl_prog_data,
const struct spl_scaler_data *scl_data)
{ … }
static const uint16_t *spl_dscl_get_filter_coeffs_64p(int taps, struct fixed31_32 ratio)
{ … }
static void spl_set_filters_data(struct dscl_prog_data *dscl_prog_data,
const struct spl_scaler_data *data)
{ … }
static const uint16_t *spl_dscl_get_blur_scale_coeffs_64p(int taps)
{ … }
static void spl_set_blur_scale_data(struct dscl_prog_data *dscl_prog_data,
const struct spl_scaler_data *data)
{ … }
static void spl_set_dscl_prog_data(struct spl_in *spl_in, struct spl_out *spl_out)
{ … }
static bool enable_easf(int scale_ratio, int taps,
enum linear_light_scaling lls_pref, bool prefer_easf)
{ … }
static void spl_set_easf_data(struct dscl_prog_data *dscl_prog_data,
bool enable_easf_v, bool enable_easf_h, enum linear_light_scaling lls_pref,
enum spl_pixel_format format)
{ … }
static void spl_set_isharp_noise_det_mode(struct dscl_prog_data *dscl_prog_data)
{
if (dscl_prog_data->taps.v_taps == 6)
dscl_prog_data->isharp_noise_det.mode = 3;
else if (dscl_prog_data->taps.h_taps == 4)
dscl_prog_data->isharp_noise_det.mode = 1;
else if (dscl_prog_data->taps.h_taps == 3)
dscl_prog_data->isharp_noise_det.mode = 0;
};
static void spl_set_isharp_data(struct dscl_prog_data *dscl_prog_data,
struct adaptive_sharpness adp_sharpness, bool enable_isharp,
enum linear_light_scaling lls_pref, enum spl_pixel_format format,
const struct spl_scaler_data *data)
{ … }
static bool spl_get_isharp_en(struct adaptive_sharpness adp_sharpness,
int vscale_ratio, int hscale_ratio, struct spl_taps taps,
enum spl_pixel_format format)
{ … }
static bool spl_choose_lls_policy(enum spl_pixel_format format,
enum spl_transfer_func_type tf_type,
enum spl_transfer_func_predefined tf_predefined_type,
enum linear_light_scaling *lls_pref)
{ … }
bool spl_calculate_scaler_params(struct spl_in *spl_in, struct spl_out *spl_out)
{ … }