W3C home > Mailing lists > Public > public-media-capture@w3.org > August 2014

Re: [Bug 26526] Fix aspect ratio constraint

From: Harald Alvestrand <harald@alvestrand.no>
Date: Thu, 14 Aug 2014 18:21:15 +0200
Message-ID: <53ECE1FB.5060406@alvestrand.no>
To: "Gili T." <cowwoc@bbs.darktech.org>, public-media-capture@w3.org
On 08/14/2014 05:45 PM, Gili T. wrote:
>
> Hi Harald,
>
> Can you please explain how an epsilon of 1/1000 equates to one pixel 
> in HD?
>

The aspect ratio of a 1024x768 image is 1.3333333333
The aspect ratio of a 1025x768 image is 1.3346354166
The difference is 0.0013020833, which is quite close to 1/1000.

> What able future proofing? What happens when we want 4k resolution in 
> the future?
>

On 4K resolution, the difference will be ~4 pixels. Most coding schemes 
have 16-pixel macroblocks.

The point is - 1/1000 is *precise enough for all practical purposes*.

Nobody NEEDS to specify an aspect ratio of 1.3334 and not have it match 
1.3333.

> Thanks,
> Gili
>
> On Aug 13, 2014 1:11 PM, "Harald Alvestrand" <harald@alvestrand.no 
> <mailto:harald@alvestrand.no>> wrote:
>
>     On 08/13/2014 12:11 PM, Gili T. wrote:
>>
>>     And I'll repeat that different ratios will need different
>>     epsilons. Epsilons imply inaccuracy and there is no one number
>>     that will work for every use case. Why not just go with
>>     "numerator/denominator", parse it to two integers and compare
>>     with 100% accuracy?
>>
>
>     Did you intend for this to go to me only?
>
>     1/1000 is one pixel in HD. We don't need more precision.
>
>
>>     Gili
>>
>>     On Aug 13, 2014 8:50 AM, "Harald Alvestrand"
>>     <harald@alvestrand.no <mailto:harald@alvestrand.no>> wrote:
>>
>>         On 08/12/2014 06:17 PM, Jan-Ivar Bruaroey wrote:
>>
>>             On 8/11/14 6:17 PM, Martin Thomson wrote:
>>
>>                 On 11 August 2014 14:34, Jan-Ivar Bruaroey
>>                 <jib@mozilla.com <mailto:jib@mozilla.com>> wrote:
>>
>>                     Actually, the spec already says: "The exact
>>                     aspect ratio (width in pixels
>>                     divided by height in pixels), represented as a
>>                     double rounded to the tenth
>>                     decimal place" [1]
>>
>>                     So we effectively have our epsilon already:
>>                     .0000000001
>>
>>                     So no action required it seems.
>>
>>                 Oh, that's good, there's an epsilon; but it's bad.
>>                  1.777777778 isn't
>>                 the same as 16/9 based on that.  Nor is 1.7777777777.
>>                  Add a single
>>                 digit to either and it would match.  I may have
>>                 counted wrong. I'm
>>                 sure that others will too.
>>
>>
>>             Feel free to propose a different epsilon I suppose.
>>
>>             I presume this would have nothing to do with inaccuracies
>>             inherent in floating-point math then (or we could have
>>             picked an epsilon much closer to everyone's worst machine
>>             epsilon), but instead from a desire to accommodate people
>>             handwriting rounded decimal numbers for aspect. Just so
>>             we're clear on the properties we seek.
>>
>>
>>         I'll repeat my suggestion of an epsilon of 1/1000.
>>
>>
>>             .: Jan-Ivar :.
>>
>>
>>
>>
>
Received on Thursday, 14 August 2014 16:21:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:29 UTC