45 #define COLOR_DIFF_COEFF_SIZE 512
73 #define RADIUS_MIN 0.1
74 #define RADIUS_MAX 4.0
76 #define PRE_FILTER_RADIUS_MIN 0.1
77 #define PRE_FILTER_RADIUS_MAX 2.0
79 #define STRENGTH_MIN 0.1
80 #define STRENGTH_MAX 100.0
82 #define OFFSET(x) offsetof(SabContext, x)
83 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
123 "luma_radius:%f luma_pre_filter_radius::%f luma_strength:%f "
124 "chroma_radius:%f chroma_pre_filter_radius:%f chroma_strength:%f\n",
153 int linesize =
FFALIGN(width, 8);
165 sws_flags, &sws_f, NULL, NULL);
171 int index = i-COLOR_DIFF_COEFF_SIZE/2 + vec->
length/2;
173 if (index < 0 || index >= vec->
length) d = 0.0;
189 for (y = 0; y < vec->
length; y++) {
190 for (x = 0; x < vec->
length; x++) {
232 int src2_linesize[
NB_PLANES] = { src_linesize };
238 #define UPDATE_FACTOR do { \
240 factor = f.color_diff_coeff[COLOR_DIFF_COEFF_SIZE/2 + pre_val - \
241 f.pre_filter_buf[ix + iy*f.pre_filter_linesize]] * f.dist_coeff[dx + dy*f.dist_linesize]; \
242 sum += src[ix + iy*src_linesize] * factor; \
246 for (y = 0; y < h; y++) {
247 for (x = 0; x < w; x++) {
252 if (x >= radius && x < w - radius) {
253 for (dy = 0; dy < radius*2 + 1; dy++) {
255 int iy = y+dy - radius;
256 if (iy < 0) iy = -iy;
257 else if (iy >= h) iy = h+h-iy-1;
259 for (dx = 0; dx < radius*2 + 1; dx++) {
260 const int ix = x+dx - radius;
265 for (dy = 0; dy < radius*2+1; dy++) {
267 int iy = y+dy - radius;
268 if (iy < 0) iy = -iy;
269 else if (iy >= h) iy = h+h-iy-1;
271 for (dx = 0; dx < radius*2 + 1; dx++) {
272 int ix = x+dx - radius;
273 if (ix < 0) ix = -ix;
274 else if (ix >= w) ix = w+w-ix-1;
279 dst[x + y*dst_linesize] = (sum + div/2) / div;
298 inlink->
w, inlink->
h, &sab->
luma);
299 if (inpic->
data[2]) {
337 .priv_class = &sab_class,