| 1 | /* |
| 2 | * This file is part of FFmpeg. |
| 3 | * |
| 4 | * FFmpeg is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * FFmpeg is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License along |
| 15 | * with FFmpeg; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | */ |
| 18 | |
| 19 | #ifndef AVFILTER_PULLUP_H |
| 20 | #define AVFILTER_PULLUP_H |
| 21 | |
| 22 | #include "avfilter.h" |
| 23 | |
| 24 | typedef struct PullupBuffer { |
| 25 | int lock[2]; |
| 26 | uint8_t *planes[4]; |
| 27 | } PullupBuffer; |
| 28 | |
| 29 | typedef struct PullupField { |
| 30 | int parity; |
| 31 | PullupBuffer *buffer; |
| 32 | unsigned flags; |
| 33 | int breaks; |
| 34 | int affinity; |
| 35 | int *diffs; |
| 36 | int *combs; |
| 37 | int *vars; |
| 38 | struct PullupField *prev, *next; |
| 39 | } PullupField; |
| 40 | |
| 41 | typedef struct PullupFrame { |
| 42 | int lock; |
| 43 | int length; |
| 44 | int parity; |
| 45 | PullupBuffer *ifields[4], *ofields[2]; |
| 46 | PullupBuffer *buffer; |
| 47 | } PullupFrame; |
| 48 | |
| 49 | typedef struct PullupContext { |
| 50 | const AVClass *class; |
| 51 | int junk_left, junk_right, junk_top, junk_bottom; |
| 52 | int metric_plane; |
| 53 | int strict_breaks; |
| 54 | int strict_pairs; |
| 55 | int metric_w, metric_h, metric_length; |
| 56 | int metric_offset; |
| 57 | int nb_planes; |
| 58 | int planewidth[4]; |
| 59 | int planeheight[4]; |
| 60 | PullupField *first, *last, *head; |
| 61 | PullupBuffer buffers[10]; |
| 62 | PullupFrame frame; |
| 63 | |
| 64 | int (*diff)(const uint8_t *a, const uint8_t *b, ptrdiff_t s); |
| 65 | int (*comb)(const uint8_t *a, const uint8_t *b, ptrdiff_t s); |
| 66 | int (*var )(const uint8_t *a, const uint8_t *b, ptrdiff_t s); |
| 67 | } PullupContext; |
| 68 | |
| 69 | void ff_pullup_init_x86(PullupContext *s); |
| 70 | |
| 71 | #endif /* AVFILTER_PULLUP_H */ |