On 6/17/2024 2:07 PM, Derek Buitenhuis wrote:
On 6/17/2024 5:53 PM, James Almer wrote:
Maybe this should be an AVRational then.

While that is probably 'more correct', it does mean that in 100% places
this could be used, it'll have to be converted back to the -10000 to 10000
range. Is there a simple way to do that with an AVRational that doesn't
involve a round trip to a double or float (i.e. lossy)?

No, it's av_d2q(), av_q2d(), and av_rescale() as needed. Same as we do for Mastering Display and Ambient Viewing Environment Metadata. The reason to use AVRational is that in this specific spec the values have a denominator of 10000, but in others it doesn't need to, allowing for more precise values (Matroska would store it as a double, in fact).

So we shouldn't define our API for one specific implementation but rather in a generic way that should accommodate to any potential implementation. I think we already did the former with a Google implementation (x.y fixed point values), and i want to avoid doing it again.


- Derek
_______________________________________________
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".

Reply via email to