-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
section 3.8.1.1 should have pseudocode #231
Comments
IIRC the ==> <==> is not intended to be pseudocode. That is its not a "if" in code but rather a mathematical definition of the stream |
b_(i) = 0 implies L_(i) < R_(i) - r_(i) in words IIRC
So these things should define both the decoding and encoding |
okay, so this is an attempt do a bijection of the mapping to/from code state and bitstream? |
A <== B <==> C is meant as |
What's worth noting is that this is the only bit of the spec that uses a mathematical definition like this (contrast it to the golomb-rice coding part of the spec). When I implemented go-ffv1 I essentially ignored this part of the spec entirely, and had to use the original paper cited, and a bit of wikipedia. (I mentioned as much here: https://youtu.be/4HB7v7dItWE / https://mediaarea.net/Events/2019-12-05_NoTimeToWait4/13.%20Derek%20Buitenhuis%20-%20I%20Wrote%20an%20FFV1%20decoder%20in%20Go%20for%20Fun,%20What%20I%20learned%20going%20from%20Spec%20to%20Implementation/derek_nttw4_ffv1.pdf) |
@dwbuiten would you mind to suggest a patch to the spec about that for having all in the spec? |
I can devise a patch using pseudocode, but I'd like to hear @michaelni's opinion first. |
I find the mathematical definition quite elegant but it clearly is not working for people. So adding pseudocode for the get/put is the logic solution. Iam in favor to add such pseudocode in addition to the mathematical stuff |
As the spec is, as most (all?) specs, focused on decoding, I suggest to have the pseudocode for the "get" part only, in addition of the mathematical definition focused on the "put" part we already have, it may be a good balance between not enough and too much. |
I agree |
Can this issue be closed now that there is pseudocode? |
I suggest leaving this issue open as there's active discussion in Barry's DISCUSS and his recent comments. Barry notes that the formulae would be more readable with more definitions to each component variable of the formulae. As Barry suggested I moved the variables from a narrative to definition list in https://github.com/FFmpeg/FFV1/pull/255/files, but I need input on adding the other missing variables. My draft is:
but am I understanding this values correctly? @michaelni @dwbuiten I think it would be helpful too to make the cross-references of Table 4 more specific by referencing the Figure of the formula rather than the full section. Currently, we have:
Can these cross-references be more precise? |
new nudge to @michaelni @dwbuiten on the questions of my last comment. Also for the formula of Section 3.8.1.1 would it make sense to group them in regards to the purpose they have? |
I agree with Barry that it's easier to parse as separate variables. I'm not really sure how you intend to cross reference with Table 4, though? It's not really beneficial. |
It looks like this issue can be closed (#259 is merged). |
The interpretation of the <== and <==> is not clear.
There is clearly a IF/THEN implied, but it is not clear how to code this.
S_(i + 1, C_(i)) = zero_state_(S_(i, C_(i))) AND
l_(i) = L_(i) AND
t_(i) = R_(i) - r_(i) <==
(b_(i) = 0 <==>
L_(i) < R_(i) - r_(i))
MAYBE:
The text was updated successfully, but these errors were encountered: