|
FFmpeg
|
#include <math.h>#include <stdbool.h>#include <libavutil/attributes.h>#include <libavutil/avassert.h>#include <libavutil/mem.h>#include "filters.h"Go to the source code of this file.
Data Structures | |
| struct | SwsFilterFunction |
Macros | |
| #define | RADIUS_MAX 10.0 |
Typedefs | |
| typedef double(* | SwsFilterKernel) (double x, const double *params) |
Variables | |
| static const SwsFilterFunction | filter_functions [SWS_SCALE_NB] |
|
static |
Definition at line 50 of file filters.c.
Referenced by compute_row(), and filter_radius().
|
static |
Explanation of the 0.5 offsets: Normally, pixel samples are assumed to be representative of the center of their containing area; e.g. for a 2x2 image, the samples are located at {0.5, 1.5}^2. However, with integer indexing, we round sample positions down (0-based indexing). So the (0, 0) sample is actually located at (0.5, 0.5) and represents the entire square from (0,0) to (1,1). When normalizing between different image sizes, we therefore need to add/subtract off these 0.5 offsets.
Generate raw filter weights with maximum precision. Sum the positive and negative weights separately to avoid catastrophic cancellation. This summation order should already give the best precision because abs(w) is monotonically decreasing
Definition at line 62 of file filters.c.
Referenced by ff_sws_filter_generate().
|
static |
Definition at line 136 of file filters.c.
Referenced by ff_sws_filter_generate().
|
static |
Definition at line 143 of file filters.c.
Referenced by ff_sws_filter_generate().
|
static |
Definition at line 157 of file filters.c.
Referenced by ff_sws_filter_generate().
| int ff_sws_filter_generate | ( | void * | log_ctx, |
| const SwsFilterParams * | params, | ||
| SwsFilterWeights ** | out | ||
| ) |
Generate a filter kernel for the given parameters.
The generated filter is allocated as a refstruct and must be unref'd by the caller.
Returns 0 or a negative error code. In particular, this may return:
SWS_SCALE_AREA is a pseudo-filter that is equivalent to bilinear filtering for upscaling (since bilinear just evenly mixes samples according to the relative distance), and equivalent to (anti-aliased) point sampling for downscaling.
Definition at line 183 of file filters.c.
Referenced by check_filter().
Definition at line 296 of file filters.c.
Referenced by colormap_insert(), compute_box_stats(), ddagrab_request_frame(), drawbox_vaapi_filter_frame(), filter_frame(), get_next_box_id_to_split(), get_next_color(), get_palette_frame(), load_colormap(), split_box(), and subshift().
|
static |
Definition at line 48 of file filters.c.
Referenced by ff_sws_filter_generate().
1.8.17