On Wed, 11 Dec 2024 01:35:25 +0100 Michael Niedermayer <mich...@niedermayer.cc> wrote: > Hi > > On Fri, Dec 06, 2024 at 03:32:01PM +0100, Niklas Haas wrote: > > From: Niklas Haas <g...@haasn.dev> > > > > Only add the condensed values that we actually care about. Group them into > > a new struct to make it easier to discard or replace this metadata. > > > > Define a special comparison function that does not choke on > > undefined/unknown > > metadata. > > [...] > > > diff --git a/libswscale/utils.h b/libswscale/utils.h > > index 4d204ef6cc..1263e3f8ed 100644 > > --- a/libswscale/utils.h > > +++ b/libswscale/utils.h > > @@ -21,26 +21,55 @@ > > #ifndef SWSCALE_UTILS_H > > #define SWSCALE_UTILS_H > > > > +#include "libavutil/csp.h" > > #include "libavutil/pixdesc.h" > > > > #include "swscale.h" > > > > +/* Like av_cmp_q but considers 0/0 == 0/0 */ > > +static inline int ff_q_equal(const AVRational a, const AVRational b) > > +{ > > + return (a.den || b.den) ? !av_cmp_q(a, b) : a.den == b.den; > > +} > > in which case is a.den == b.den untrue ?
AVRational undef = {0, 0}; AVRational zero = {0, 1}; AVRational one = {1, 1}; ff_q_equal(undef, undef) == 1 ff_q_equal(zero, zero) == 1 ff_q_equal(one, one) == 1 ff_q_equal(undef, zero) == 0 ff_q_equal(undef, one) == 0 ff_q_equal(zero, one) == 0 Contrast with av_cmp_q which would give INT_MIN for the cases involving undef. > > > [...] > > thx > > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > If you fake or manipulate statistics in a paper in physics you will never > get a job again. > If you fake or manipulate statistics in a paper in medicin you will get > a job for life at the pharma industry. > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".