/* 'num' is normalized so that it is such as 0 <= num < den. */
static void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
/* 'num' is normalized so that it is such as 0 <= num < den. */
static void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
{
    num += (den >> 1);
    if (num >= den) {
        val += num / den;
        num = num % den;
    }
    f->val = val;
    f->num = num;
    f->den = den;
}