#include "dc_spl.h"
#include "dc_spl_scl_filters.h"
#include "dc_spl_scl_easf_filters.h"
#include "dc_spl_isharp_filters.h"
#include "spl_debug.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_scratch *spl_scratch, struct spl_out *spl_out)
{ … }
static void spl_calculate_scaling_ratios(struct spl_in *spl_in,
struct spl_scratch *spl_scratch,
struct spl_out *spl_out)
{ … }
static void spl_calculate_viewport_size(struct spl_in *spl_in, struct spl_scratch *spl_scratch)
{ … }
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 spl_fixed31_32 ratio,
struct spl_fixed31_32 init_adj,
struct spl_fixed31_32 *init,
int *vp_offset,
int *vp_size)
{ … }
static bool spl_is_yuv420(enum spl_pixel_format format)
{ … }
static bool spl_is_rgb8(enum spl_pixel_format format)
{ … }
static void spl_calculate_inits_and_viewports(struct spl_in *spl_in,
struct spl_scratch *spl_scratch)
{ … }
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,
bool enable_isharp, bool enable_easf)
{ … }
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)
{ … }
static bool enable_easf(struct spl_in *spl_in, struct spl_scratch *spl_scratch)
{ … }
static bool spl_is_video_fullscreen(struct spl_in *spl_in)
{ … }
static bool spl_get_isharp_en(struct spl_in *spl_in,
struct spl_scratch *spl_scratch)
{ … }
static bool spl_get_optimal_number_of_taps(
int max_downscale_src_width, struct spl_in *spl_in, struct spl_scratch *spl_scratch,
const struct spl_taps *in_taps, bool *enable_easf_v, bool *enable_easf_h,
bool *enable_isharp)
{ … }
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 void spl_set_dscl_prog_data(struct spl_in *spl_in, struct spl_scratch *spl_scratch,
struct spl_out *spl_out, bool enable_easf_v, bool enable_easf_h, bool enable_isharp)
{ … }
static void spl_calculate_c0_c3_hdr(struct dscl_prog_data *dscl_prog_data, uint32_t sdr_white_level_nits)
{ … }
static void spl_set_easf_data(struct spl_scratch *spl_scratch, struct spl_out *spl_out, bool enable_easf_v,
bool enable_easf_h, enum linear_light_scaling lls_pref,
enum spl_pixel_format format, enum system_setup setup,
uint32_t sdr_white_level_nits)
{ … }
static void spl_set_isharp_noise_det_mode(struct dscl_prog_data *dscl_prog_data,
const struct spl_scaler_data *data)
{
if (data->taps.v_taps == 6)
dscl_prog_data->isharp_noise_det.mode = 3;
else if (data->taps.v_taps == 4)
dscl_prog_data->isharp_noise_det.mode = 1;
else if (data->taps.v_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, struct spl_fixed31_32 ratio,
enum system_setup setup, enum scale_to_sharpness_policy scale_to_sharpness_policy)
{ … }
bool spl_calculate_scaler_params(struct spl_in *spl_in, struct spl_out *spl_out)
{ … }