You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
527 B
20 lines
527 B
/************************************************************************/
|
|
/* 定义分数 */
|
|
/************************************************************************/
|
|
#ifndef RATIONAL_H
|
|
#define RATIONAL_H
|
|
|
|
/* 分数结构体 */
|
|
typedef struct AVRational
|
|
{
|
|
int num; // numerator // 分子
|
|
int den; // denominator // 分母
|
|
} AVRational;
|
|
|
|
/* 计算分数 */
|
|
static inline double av_q2d(AVRational a)
|
|
{
|
|
return a.num / (double)a.den;
|
|
}
|
|
|
|
#endif
|
|
|