FFmpeg
Macros | Functions
mpeg12framerate.c File Reference
#include "libavcodec/mpeg12.h"
#include "libavcodec/mpeg12data.h"

Go to the source code of this file.

Macros

#define TEST_MATCH(frame_rate, code, ext_n, ext_d)
 
#define TEST_EXACT(frn, frd)
 

Functions

int main (void)
 

Macro Definition Documentation

#define TEST_MATCH (   frame_rate,
  code,
  ext_n,
  ext_d 
)
Value:
do { \
AVRational fr = frame_rate; \
int c, n, d; \
if (c != code || n != ext_n || d != ext_d) { \
av_log(NULL, AV_LOG_ERROR, "Failed to match %d/%d: " \
"code = %d, ext_n = %d, ext_d = %d.\n", \
fr.num, fr.den, c, n, d); \
return 1; \
} \
} while (0)
#define NULL
Definition: coverity.c:32
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
int n
Definition: avisynth_c.h:760
if(ret)
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
int
void ff_mpeg12_find_best_frame_rate(AVRational frame_rate, int *code, int *ext_n, int *ext_d, int nonstandard)
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 it should return

Referenced by main().

#define TEST_EXACT (   frn,
  frd 
)
Value:
do { \
AVRational fr = (AVRational) { frn, frd }; \
int c, n, d; \
(AVRational) { n + 1, d + 1 })) != 0) { \
av_log(NULL, AV_LOG_ERROR, "Failed to find exact %d/%d: " \
"code = %d, ext_n = %d, ext_d = %d.\n", \
fr.num, fr.den, c, n, d); \
return 1; \
} \
} while (0)
#define NULL
Definition: coverity.c:32
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
int n
Definition: avisynth_c.h:760
if(ret)
Rational number (pair of numerator and denominator).
Definition: rational.h:58
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
Definition: rational.h:89
int
void ff_mpeg12_find_best_frame_rate(AVRational frame_rate, int *code, int *ext_n, int *ext_d, int nonstandard)
const AVRational ff_mpeg12_frame_rate_tab[16]
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 it should return
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
Definition: rational.c:80

Referenced by main().

Function Documentation

int main ( void  )

Definition at line 22 of file mpeg12framerate.c.