FFmpeg
Macros | Functions
mpeg12framerate.c File Reference
#include <stddef.h>
#include "libavutil/log.h"
#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

◆ TEST_MATCH

#define TEST_MATCH (   frame_rate,
  code,
  ext_n,
  ext_d 
)
Value:
do { \
AVRational fr = frame_rate; \
int c, n, d; \
ff_mpeg12_find_best_frame_rate(fr, &c, &n, &d, 0); \
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)

◆ TEST_EXACT

#define TEST_EXACT (   frn,
  frd 
)
Value:
do { \
AVRational fr = (AVRational) { frn, frd }; \
int c, n, d; \
ff_mpeg12_find_best_frame_rate(fr, &c, &n, &d, 0); \
(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)

Function Documentation

◆ main()

int main ( void  )

Definition at line 25 of file mpeg12framerate.c.

AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
NULL
#define NULL
Definition: coverity.c:32
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
c
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
code
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
Definition: filter_design.txt:178
av_cmp_q
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
Definition: rational.h:89
av_mul_q
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
Definition: rational.c:80
d
d
Definition: ffmpeg_filter.c:409
ff_mpeg12_frame_rate_tab
const AVRational ff_mpeg12_frame_rate_tab[16]
Definition: mpeg12framerate.c:24