Lines Matching defs:intnum
67 static int read_number(const AVOption *o, void *dst, double *num, int *den, int64_t *intnum)
70 case AV_OPT_TYPE_FLAGS: *intnum = *(unsigned int*)dst;return 0;
71 case AV_OPT_TYPE_INT: *intnum = *(int *)dst;return 0;
72 case AV_OPT_TYPE_INT64: *intnum = *(int64_t *)dst;return 0;
75 case AV_OPT_TYPE_RATIONAL: *intnum = ((AVRational*)dst)->num;
82 static int write_number(void *obj, const AVOption *o, void *dst, double num, int den, int64_t intnum)
84 if (o->max*den < num*intnum || o->min*den > num*intnum) {
91 case AV_OPT_TYPE_INT: *(int *)dst= llrint(num/den)*intnum; break;
92 case AV_OPT_TYPE_INT64: *(int64_t *)dst= llrint(num/den)*intnum; break;
93 case AV_OPT_TYPE_FLOAT: *(float *)dst= num*intnum/den; break;
94 case AV_OPT_TYPE_DOUBLE:*(double *)dst= num*intnum/den; break;
96 if ((int)num == num) *(AVRational*)dst= (AVRational){num*intnum, den};
97 else *(AVRational*)dst= av_d2q(num*intnum/den, 1<<24);
170 int64_t intnum = 1;
197 read_number(o, dst, NULL, NULL, &intnum);
198 if (cmd == '+') d = intnum | (int64_t)d;
199 else if (cmd == '-') d = intnum &~(int64_t)d;
201 read_number(o, dst, &num, &den, &intnum);
202 if (cmd == '+') d = notfirst*num*intnum/den + d;
203 else if (cmd == '-') d = notfirst*num*intnum/den - d;
267 static int set_number(void *obj, const char *name, double num, int den, int64_t intnum,
277 return write_number(obj, o, dst, num, den, intnum);
407 static int get_number(void *obj, const char *name, const AVOption **o_out, double *num, int *den, int64_t *intnum,
419 return read_number(o, dst, num, den, intnum);
422 *den=*intnum=0;
429 int64_t intnum=1;
433 if (get_number(obj, name, o_out, &num, &den, &intnum, 0) < 0)
435 return num*intnum/den;
440 int64_t intnum=1;
444 if (get_number(obj, name, o_out, &num, &den, &intnum, 0) < 0)
446 if (num == 1.0 && (int)intnum == intnum)
447 return (AVRational){intnum, den};
449 return av_d2q(num*intnum/den, 1<<24);
454 int64_t intnum=1;
458 if (get_number(obj, name, o_out, &num, &den, &intnum, 0) < 0)
460 return num*intnum/den;
466 int64_t intnum = 1;
470 if ((ret = get_number(obj, name, NULL, &num, &den, &intnum, search_flags)) < 0)
472 *out_val = num*intnum/den;
478 int64_t intnum = 1;
482 if ((ret = get_number(obj, name, NULL, &num, &den, &intnum, search_flags)) < 0)
484 *out_val = num*intnum/den;
490 int64_t intnum = 1;
494 if ((ret = get_number(obj, name, NULL, &num, &den, &intnum, search_flags)) < 0)
497 if (num == 1.0 && (int)intnum == intnum)
498 *out_val = (AVRational){intnum, den};
500 *out_val = av_d2q(num*intnum/den, 1<<24);