| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Ported to FFmpeg from MPlayer libmpcodecs/unsharp.c | 2 * Ported to FFmpeg from MPlayer libmpcodecs/unsharp.c |
| 3 * Original copyright (C) 2002 Remi Guyomarch <rguyom@pobox.com> | 3 * Original copyright (C) 2002 Remi Guyomarch <rguyom@pobox.com> |
| 4 * Port copyright (C) 2010 Daniel G. Taylor <dan@programmer-art.org> | 4 * Port copyright (C) 2010 Daniel G. Taylor <dan@programmer-art.org> |
| 5 * Relicensed to the LGPL with permission from Remi Guyomarch. | 5 * Relicensed to the LGPL with permission from Remi Guyomarch. |
| 6 * | 6 * |
| 7 * This file is part of FFmpeg. | 7 * This file is part of FFmpeg. |
| 8 * | 8 * |
| 9 * FFmpeg is free software; you can redistribute it and/or | 9 * FFmpeg is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Lesser General Public | 10 * modify it under the terms of the GNU Lesser General Public |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 { | 126 { |
| 127 UnsharpContext *unsharp = ctx->priv; | 127 UnsharpContext *unsharp = ctx->priv; |
| 128 int lmsize_x = 5, cmsize_x = 0; | 128 int lmsize_x = 5, cmsize_x = 0; |
| 129 int lmsize_y = 5, cmsize_y = 0; | 129 int lmsize_y = 5, cmsize_y = 0; |
| 130 double lamount = 1.0f, camount = 0.0f; | 130 double lamount = 1.0f, camount = 0.0f; |
| 131 | 131 |
| 132 if (args) | 132 if (args) |
| 133 sscanf(args, "%d:%d:%lf:%d:%d:%lf", &lmsize_x, &lmsize_y, &lamount, | 133 sscanf(args, "%d:%d:%lf:%d:%d:%lf", &lmsize_x, &lmsize_y, &lamount, |
| 134 &cmsize_x, &cmsize_y, &camount); | 134 &cmsize_x, &cmsize_y, &camount); |
| 135 | 135 |
| 136 if (lmsize_x < 2 || lmsize_y < 2 || cmsize_x < 2 || cmsize_y < 2) { | 136 if ((lamount && (lmsize_x < 2 || lmsize_y < 2)) || |
| 137 (camount && (cmsize_x < 2 || cmsize_y < 2))) { |
| 137 av_log(ctx, AV_LOG_ERROR, | 138 av_log(ctx, AV_LOG_ERROR, |
| 138 "Invalid value <2 for lmsize_x:%d or lmsize_y:%d or cmsize_x:%d o
r cmsize_y:%d\n", | 139 "Invalid value <2 for lmsize_x:%d or lmsize_y:%d or cmsize_x:%d o
r cmsize_y:%d\n", |
| 139 lmsize_x, lmsize_y, cmsize_x, cmsize_y); | 140 lmsize_x, lmsize_y, cmsize_x, cmsize_y); |
| 140 return AVERROR(EINVAL); | 141 return AVERROR(EINVAL); |
| 141 } | 142 } |
| 142 | 143 |
| 143 set_filter_param(&unsharp->luma, lmsize_x, lmsize_y, lamount); | 144 set_filter_param(&unsharp->luma, lmsize_x, lmsize_y, lamount); |
| 144 set_filter_param(&unsharp->chroma, cmsize_x, cmsize_y, camount); | 145 set_filter_param(&unsharp->chroma, cmsize_x, cmsize_y, camount); |
| 145 | 146 |
| 146 return 0; | 147 return 0; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 .draw_slice = draw_slice, | 235 .draw_slice = draw_slice, |
| 235 .end_frame = end_frame, | 236 .end_frame = end_frame, |
| 236 .config_props = config_props, | 237 .config_props = config_props, |
| 237 .min_perms = AV_PERM_READ, }, | 238 .min_perms = AV_PERM_READ, }, |
| 238 { .name = NULL}}, | 239 { .name = NULL}}, |
| 239 | 240 |
| 240 .outputs = (AVFilterPad[]) {{ .name = "default", | 241 .outputs = (AVFilterPad[]) {{ .name = "default", |
| 241 .type = AVMEDIA_TYPE_VIDEO, }, | 242 .type = AVMEDIA_TYPE_VIDEO, }, |
| 242 { .name = NULL}}, | 243 { .name = NULL}}, |
| 243 }; | 244 }; |
| OLD | NEW |