FFmpeg
Loading...
Searching...
No Matches
dts_gen.c File Reference
#include <stdio.h>
#include "libavutil/macros.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/codec_desc.h"
#include "libavcodec/dts_gen.h"

Go to the source code of this file.

Data Structures

struct  Case
 

Macros

#define NP   AV_NOPTS_VALUE
 
#define ARRAY(a)
 
#define SEQ(...)
 
#define DTS(...)
 

Functions

static AVCodecContext * alloc_context (enum AVCodecID id, AVRational framerate)
 
static int run_case (const Case *c)
 
static int run_reset (void)
 
static int run_invalid_delays (void)
 
int main (void)
 

Variables

static const int64_t cfr [] = { 0, 10, 20, 30, 40, 50, 60, 70, 80 }
 
static const int64_t vfr [] = { 0, 5, 25, 45, 65, 85, 105, 125, 145 }
 
static const int64_t cfr_out [] = { 0, 40, 20, 10, 30, 80, 60, 50, 70 }
 
static const int64_t vfr_out [] = { 0, 65, 25, 5, 45, 145, 105, 85, 125 }
 
static const Case cases []
 

Macro Definition Documentation

◆ NP

#define NP   AV_NOPTS_VALUE

Definition at line 27 of file dts_gen.c.

◆ ARRAY

#define ARRAY ( a)
Value:
int a
#define FF_ARRAY_ELEMS(a)

Definition at line 50 of file dts_gen.c.

◆ SEQ

#define SEQ ( ...)
Value:
(const int64_t[]) { __VA_ARGS__ }, \
FF_ARRAY_ELEMS(((const int64_t[]) { __VA_ARGS__ }))
long long int64_t
Definition coverity.c:34

Definition at line 51 of file dts_gen.c.

◆ DTS

#define DTS ( ...)
Value:
(const int64_t[]) { __VA_ARGS__ }

Definition at line 53 of file dts_gen.c.

Function Documentation

◆ alloc_context()

static AVCodecContext * alloc_context ( enum AVCodecID id,
AVRational framerate )
static

Definition at line 89 of file dts_gen.c.

Referenced by run_case(), run_invalid_delays(), and run_reset().

◆ run_case()

static int run_case ( const Case * c)
static

Definition at line 102 of file dts_gen.c.

Referenced by main().

◆ run_reset()

static int run_reset ( void )
static

Definition at line 137 of file dts_gen.c.

Referenced by main().

◆ run_invalid_delays()

static int run_invalid_delays ( void )
static

Definition at line 165 of file dts_gen.c.

Referenced by main().

◆ main()

int main ( void )

Definition at line 188 of file dts_gen.c.

Variable Documentation

◆ cfr

const int64_t cfr[] = { 0, 10, 20, 30, 40, 50, 60, 70, 80 }
static

Definition at line 30 of file dts_gen.c.

◆ vfr

const int64_t vfr[] = { 0, 5, 25, 45, 65, 85, 105, 125, 145 }
static

Definition at line 31 of file dts_gen.c.

Referenced by optimize_colors().

◆ cfr_out

const int64_t cfr_out[] = { 0, 40, 20, 10, 30, 80, 60, 50, 70 }
static

Definition at line 34 of file dts_gen.c.

◆ vfr_out

const int64_t vfr_out[] = { 0, 65, 25, 5, 45, 145, 105, 85, 125 }
static

Definition at line 35 of file dts_gen.c.

◆ cases

const Case cases[]
static
Initial value:
= {
{ "no reordering", AV_CODEC_ID_H264, 0, { 0, 0 },
ARRAY(cfr), ARRAY(cfr), DTS(0, 10, 20, 30, 40, 50, 60, 70, 80) },
{ "reordering", AV_CODEC_ID_H264, 2, { 0, 0 },
ARRAY(cfr), ARRAY(cfr_out), DTS(-20, -10, 0, 10, 20, 30, 40, 50, 60) },
{ "variable frame rate", AV_CODEC_ID_H264, 2, { 0, 0 },
ARRAY(vfr), ARRAY(vfr_out), DTS(-10, -5, 0, 5, 25, 45, 65, 85, 105) },
{ "delay above depth", AV_CODEC_ID_H264, 4, { 0, 0 },
ARRAY(cfr), ARRAY(cfr_out), DTS(-40, -30, -20, -10, 0, 10, 20, 30, 40) },
ARRAY(cfr), ARRAY(cfr_out), DTS(NP, NP, NP, NP, NP, NP, NP, NP, NP) },
{ "repeated pts", AV_CODEC_ID_H264, 1, { 0, 0 },
SEQ(0, 1, 1, 2), SEQ(0, 1, 1, 2), DTS(-1, 0, 1, 1), 1 },
{ "recorded interval", AV_CODEC_ID_H264, 2, { 50, 1 },
ARRAY(cfr), ARRAY(cfr_out), DTS(-20, -10, 0, 10, 20, 30, 40, 50, 60) },
{ "frame rate", AV_CODEC_ID_H264, 2, { 50, 1 },
NULL, 0, ARRAY(cfr_out), DTS(-40, -20, 0, 10, 20, 30, 40, 50, 60) },
{ "one tick", AV_CODEC_ID_H264, 2, { 0, 0 },
NULL, 0, ARRAY(cfr_out), DTS(-2, -1, 0, 10, 20, 30, 40, 50, 60) },
{ "first packet not earliest", AV_CODEC_ID_H264, 2, { 0, 0 },
SEQ(0, 10, 20, 30, 40, 50), SEQ(20, 0, 10, 50, 30, 40),
DTS(-20, -10, 0, 10, 20, 30) },
{ "codec without reordering", AV_CODEC_ID_AV1, FF_DTS_GEN_DELAY_SKIP,
{ 0, 0 }, ARRAY(cfr), ARRAY(cfr), DTS(0, 10, 20, 30, 40, 50, 60, 70, 80) },
}
#define NULL
Definition coverity.c:32
#define FF_DTS_GEN_DELAY_SKIP
Definition dts_gen.h:34
@ AV_CODEC_ID_H264
Definition codec_id.h:77
@ AV_CODEC_ID_AV1
Definition codec_id.h:275
#define ARRAY(a)
Definition dts_gen.c:50
#define SEQ(...)
Definition dts_gen.c:51
static const int64_t cfr[]
Definition dts_gen.c:30
static const int64_t vfr_out[]
Definition dts_gen.c:35
static const int64_t vfr[]
Definition dts_gen.c:31
static const int64_t cfr_out[]
Definition dts_gen.c:34
#define DTS(...)
Definition dts_gen.c:53
#define NP
Definition dts_gen.c:27

Definition at line 55 of file dts_gen.c.

Referenced by main(), test_adjust_ntsc(), and test_init().