FFmpeg  4.3
yadif.h
Go to the documentation of this file.
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 Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 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 GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along 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_YADIF_H
20 #define AVFILTER_YADIF_H
21 
22 #include "libavutil/opt.h"
23 #include "libavutil/pixdesc.h"
24 #include "avfilter.h"
25 
26 enum YADIFMode {
27  YADIF_MODE_SEND_FRAME = 0, ///< send 1 frame for each frame
28  YADIF_MODE_SEND_FIELD = 1, ///< send 1 frame for each field
29  YADIF_MODE_SEND_FRAME_NOSPATIAL = 2, ///< send 1 frame for each frame but skips spatial interlacing check
30  YADIF_MODE_SEND_FIELD_NOSPATIAL = 3, ///< send 1 frame for each field but skips spatial interlacing check
31 };
32 
34  YADIF_PARITY_TFF = 0, ///< top field first
35  YADIF_PARITY_BFF = 1, ///< bottom field first
36  YADIF_PARITY_AUTO = -1, ///< auto detection
37 };
38 
39 enum YADIFDeint {
40  YADIF_DEINT_ALL = 0, ///< deinterlace all frames
41  YADIF_DEINT_INTERLACED = 1, ///< only deinterlace frames marked as interlaced
42 };
43 
45  YADIF_FIELD_BACK_END = -1, ///< The last frame in a sequence
46  YADIF_FIELD_END = 0, ///< The first or last field in a sequence
47  YADIF_FIELD_NORMAL = 1, ///< A normal field in the middle of a sequence
48 };
49 
50 typedef struct YADIFContext {
51  const AVClass *class;
52 
53  int mode; ///< YADIFMode
54  int parity; ///< YADIFParity
55  int deint; ///< YADIFDeint
56 
58 
63 
64  void (*filter)(AVFilterContext *ctx, AVFrame *dstpic, int parity, int tff);
65 
66  /**
67  * Required alignment for filter_line
68  */
69  void (*filter_line)(void *dst,
70  void *prev, void *cur, void *next,
71  int w, int prefs, int mrefs, int parity, int mode);
72  void (*filter_edges)(void *dst, void *prev, void *cur, void *next,
73  int w, int prefs, int mrefs, int parity, int mode);
74 
76  int eof;
79 
80  /*
81  * An algorithm that treats first and/or last fields in a sequence
82  * differently can use this to detect those cases. It is the algorithm's
83  * responsibility to set the value to YADIF_FIELD_NORMAL after processing
84  * the first field.
85  */
86  int current_field; ///< YADIFCurrentField
87 } YADIFContext;
88 
89 void ff_yadif_init_x86(YADIFContext *yadif);
90 
92 
94 
95 extern const AVOption ff_yadif_options[];
96 
97 #endif /* AVFILTER_YADIF_H */
YADIF_MODE_SEND_FIELD
@ YADIF_MODE_SEND_FIELD
send 1 frame for each field
Definition: yadif.h:28
YADIFContext::parity
int parity
YADIFParity.
Definition: yadif.h:54
YADIFContext::temp_line_size
int temp_line_size
Definition: yadif.h:78
opt.h
YADIFContext::frame_pending
int frame_pending
Definition: yadif.h:57
YADIFCurrentField
YADIFCurrentField
Definition: yadif.h:44
ff_yadif_init_x86
void ff_yadif_init_x86(YADIFContext *yadif)
Definition: vf_yadif_init.c:60
YADIFContext::csp
const AVPixFmtDescriptor * csp
Definition: yadif.h:75
YADIFContext::mode
int mode
YADIFMode.
Definition: yadif.h:53
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:300
pixdesc.h
AVOption
AVOption.
Definition: opt.h:246
YADIF_MODE_SEND_FRAME
@ YADIF_MODE_SEND_FRAME
send 1 frame for each frame
Definition: yadif.h:27
YADIF_MODE_SEND_FIELD_NOSPATIAL
@ YADIF_MODE_SEND_FIELD_NOSPATIAL
send 1 frame for each field but skips spatial interlacing check
Definition: yadif.h:30
YADIF_PARITY_AUTO
@ YADIF_PARITY_AUTO
auto detection
Definition: yadif.h:36
YADIFDeint
YADIFDeint
Definition: yadif.h:39
YADIFContext::deint
int deint
YADIFDeint.
Definition: yadif.h:55
YADIF_MODE_SEND_FRAME_NOSPATIAL
@ YADIF_MODE_SEND_FRAME_NOSPATIAL
send 1 frame for each frame but skips spatial interlacing check
Definition: yadif.h:29
ctx
AVFormatContext * ctx
Definition: movenc.c:48
link
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a link
Definition: filter_design.txt:23
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:67
YADIFContext::eof
int eof
Definition: yadif.h:76
YADIFContext::temp_line
uint8_t * temp_line
Definition: yadif.h:77
YADIFParity
YADIFParity
Definition: yadif.h:33
ff_yadif_options
const AVOption ff_yadif_options[]
Definition: yadif_common.c:198
YADIFContext::out
AVFrame * out
Definition: yadif.h:62
YADIFContext::filter
void(* filter)(AVFilterContext *ctx, AVFrame *dstpic, int parity, int tff)
Definition: yadif.h:64
YADIFContext::prev
AVFrame * prev
Definition: yadif.h:61
YADIFContext::filter_line
void(* filter_line)(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode)
Required alignment for filter_line.
Definition: yadif.h:69
YADIFMode
YADIFMode
Definition: yadif.h:26
YADIFContext
Definition: yadif.h:50
uint8_t
uint8_t
Definition: audio_convert.c:194
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:264
YADIF_DEINT_ALL
@ YADIF_DEINT_ALL
deinterlace all frames
Definition: yadif.h:40
w
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo ug o o w
Definition: fate.txt:150
void
typedef void(RENAME(mix_any_func_type))
Definition: rematrix_template.c:52
YADIFContext::next
AVFrame * next
Definition: yadif.h:60
YADIF_FIELD_END
@ YADIF_FIELD_END
The first or last field in a sequence.
Definition: yadif.h:46
ff_yadif_request_frame
int ff_yadif_request_frame(AVFilterLink *link)
Definition: yadif_common.c:159
avfilter.h
AVFilterContext
An instance of a filter.
Definition: avfilter.h:338
YADIF_FIELD_NORMAL
@ YADIF_FIELD_NORMAL
A normal field in the middle of a sequence.
Definition: yadif.h:47
YADIF_DEINT_INTERLACED
@ YADIF_DEINT_INTERLACED
only deinterlace frames marked as interlaced
Definition: yadif.h:41
YADIF_FIELD_BACK_END
@ YADIF_FIELD_BACK_END
The last frame in a sequence.
Definition: yadif.h:45
YADIF_PARITY_TFF
@ YADIF_PARITY_TFF
top field first
Definition: yadif.h:34
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
YADIFContext::current_field
int current_field
YADIFCurrentField.
Definition: yadif.h:86
YADIFContext::cur
AVFrame * cur
Definition: yadif.h:59
ff_yadif_filter_frame
int ff_yadif_filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: yadif_common.c:92
YADIF_PARITY_BFF
@ YADIF_PARITY_BFF
bottom field first
Definition: yadif.h:35
YADIFContext::filter_edges
void(* filter_edges)(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode)
Definition: yadif.h:72