42 const char *tff =
"tff";
43 const char *bff =
"bff";
47 }
else if (sscanf(args,
"%u", &fieldorder->
dst_tff) == 1) {
49 }
else if (!strcmp(tff, args)) {
51 }
else if (!strcmp(bff, args)) {
59 fieldorder->
dst_tff ? tff : bff);
74 for (pix_fmt = 0; pix_fmt <
PIX_FMT_NB; pix_fmt++)
98 for (plane = 0; plane < 4; plane++) {
156 int h, plane, line_step, line_size,
line;
157 uint8_t *cpy_src, *cpy_dst;
162 "picture will move %s one line\n",
163 fieldorder->
dst_tff ?
"up" :
"down");
165 for (plane = 0; plane < 4 && inpicref->
data[plane]; plane++) {
166 line_step = inpicref->
linesize[plane];
167 line_size = fieldorder->
line_size[plane];
168 cpy_src = inpicref->
data[plane];
169 cpy_dst = outpicref->
data[plane];
176 for (line = 0; line < h; line++) {
178 memcpy(cpy_dst, cpy_src + line_step, line_size);
180 memcpy(cpy_dst, cpy_src - line_step - line_step, line_size);
182 cpy_src += line_step;
183 cpy_dst += line_step;
191 cpy_src += (h - 1) * line_step;
192 cpy_dst += (h - 1) * line_step;
193 for (line = h - 1; line >= 0 ; line--) {
195 memcpy(cpy_dst, cpy_src - line_step, line_size);
197 memcpy(cpy_dst, cpy_src + line_step + line_step, line_size);
199 cpy_src -= line_step;
200 cpy_dst -= line_step;
208 "not interlaced or field order already correct\n");
216 .
name =
"fieldorder",
AVFilterBufferRef * avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
Request a picture buffer with a specific set of permissions.
AVFilterBufferRefVideoProps * video
video buffer specific properties
int linesize[8]
number of bytes per line
AVFilterBufferRef * out_buf
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
static int query_formats(AVFilterContext *ctx)
static void end_frame(AVFilterLink *inlink)
#define AV_PERM_READ
can read from the buffer
AVFilterLink ** inputs
array of pointers to input links
static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
int top_field_first
field order
void avfilter_end_frame(AVFilterLink *link)
Notifie the next filter that the current frame has finished.
int avfilter_add_format(AVFilterFormats **avff, int fmt)
Add fmt to the list of media formats contained in *avff.
A filter pad used for either input or output.
int line_size[4]
bytes of pixel data per line for each plane
A link between two filters.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
void av_log(void *avcl, int level, const char *fmt,...)
AVFilterFormats * in_formats
Lists of formats supported by the input and output filters respectively.
const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB]
The array of all the pixel format descriptors.
int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane)
Compute the size of an image line with format pix_fmt and width width for the plane plane...
int w
agreed upon image width
AVFilter avfilter_vf_fieldorder
#define PIX_FMT_BITSTREAM
All values of a component are bit-wise packed end to end.
void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
Send a slice to the next filter.
#define av_dlog(pctx,...)
av_dlog macros Useful to print debug messages that shouldn't get compiled in normally.
int format
agreed upon media format
void avfilter_unref_buffer(AVFilterBufferRef *ref)
Remove a reference to a buffer.
A reference to an AVFilterBuffer.
#define PIX_FMT_HWACCEL
Pixel format is an HW accelerated format.
void avfilter_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref)
Add *ref as a new reference to formats.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVFilterBufferRef * avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
Add a new reference to a buffer.
void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
Notify the next filter of the start of a frame.
const char * name
filter name
AVFilterLink ** outputs
array of pointers to output links
#define AV_PERM_PRESERVE
nobody else can overwrite the buffer
static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
static AVFilterBufferRef * get_video_buffer(AVFilterLink *inlink, int perms, int w, int h)
int interlaced
is frame interlaced
unsigned int dst_tff
output bff/tff
#define AV_PERM_REUSE2
can output the buffer multiple times, modified each time
static int config_input(AVFilterLink *inlink)
void avfilter_formats_unref(AVFilterFormats **ref)
If *ref is non-NULL, remove *ref as a reference to the format list it currently points to...
AVFilterContext * dst
dest filter
uint8_t * data[8]
picture/audio data for each plane
AVFilterBufferRef * cur_buf
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
AVFilterFormats * out_formats