Skip to content
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

Range Coder and Golomb Rice pseudo-code formatting #196

Merged
merged 3 commits into from
Jun 23, 2020

Conversation

JeromeMartinez
Copy link
Contributor

From IETF review, The "type" column here appears superfluous in theses locations.
ur and sr namings are clarified by splitting the pseudo-code in 2 parts + a name for each part.
log2_run is actually an array.

@JeromeMartinez
Copy link
Contributor Author

bump ;-)

@michaelni
Copy link
Member

Other codec specifications from mpeg4 asp to h265 put pseudocode like if() interspaced with bitstream stuff in tables. So iam a bit reluctant to apply this as it would move us away from that "look"
ive applied the other commit

@JeromeMartinez JeromeMartinez force-pushed the SampleDifference branch 2 times, most recently from d98818e to 69da236 Compare May 25, 2020 16:07
@JeromeMartinez
Copy link
Contributor Author

I close this PR for the moment and send this feedback to IETF reviewers.

@JeromeMartinez
Copy link
Contributor Author

hmmm... I reopen this PR, for the remaining commit proposal, as I was actually not myself convinced while preparing my answer to AD review.

We have 2 different parts impacted about this "type" column, "Sample Coding" and "Bitstream".

  • "Sample Coding" is not explicitly describing the bitstream step by step, it is more a description with the help of some tables for the algorithm, so "type" column is not useful in this section. Actually, we already have "diff" and "get_vlc_symbol" definitions without the "type" column so it is incoherent. The commit proposal makes a coherent "look" to the "Sampling Coding" section.

  • "Bitstream" section is about the bitstream, and as in H265 we have some tables with no element read from the bitstream (Line() for example), and this commit proposal does not remove the "type" column from such table.

@michaelni please comment/review again.

@michaelni
Copy link
Member

put_symbol() doesnt fit very well to get_ur_golomb.

@JeromeMartinez
Copy link
Contributor Author

put_symbol() doesnt fit very well to get_ur_golomb.

I don't get it, could you explain a bit more?

@michaelni
Copy link
Member

put_symbol() doesnt fit very well to get_ur_golomb

I don't get it, could you explain a bit more?

one is write and one is read, that is not consistant

@michaelni
Copy link
Member

also its the bitstream and reading that is specified so it should all be read

@JeromeMartinez
Copy link
Contributor Author

one is write and one is read, that is not consistant

The PR was intended for formatting only, without change in the content (planned in a future PR after this one is merged).
Anyway I added a new commit which replaces put_symbol definition by get_symbol, please review again.

Copy link
Contributor

@retokromer retokromer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to unify either to

if ( ... ) {
    something;
}

or to:

if ( ... )
    something;

but not to mix the two coding styles.

@JeromeMartinez
Copy link
Contributor Author

I suggest to unify either to

This was my goal, but I forgot at one place, if I miss nothing else. Fixed.

@retokromer
Copy link
Contributor

I’m sorry to be picky, but here reads:

}
else {

and in other places:

} else {

@JeromeMartinez
Copy link
Contributor Author

}
else {

Fixed.

ffv1.md Outdated
```
Figure: A pseudo-code description of the contexts of Range Non Binary Values. {#figureRangeNonBinaryValueExample}

`put_symbol` is used during the process of (#coding-of-the-sample-difference).
`get_symbol` is used during the process of (#coding-of-the-sample-difference).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This becomes rendered as:

"get_symbol" is used during the process of Section 3.8.

but currently we are in a subsection of Section 3.8 so the reference feels circular.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but currently we are in a subsection of Section 3.8 so the reference feels circular.

Not really circular, the idea is to link the introduction of this section.
I added a commit for referencing the figure in the introduction of this section, for being more precise.


`put_rac` is the process described in (#range-binary-values).
`get_rac` is the process described in (#range-binary-values).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is rendered as

"get_rac" is the process described in Section 3.8.1.1.

But Section 3.8.1.1 refers to several processes. Could we add a "Figure" label to the process you mean and cross-reference that rather than the whole section. For instance, see how {#figureRelativeSampleNames} is cited.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But Section 3.8.1.1 refers to several processes.

IMO get_rac is for all figures in the section, which describe a single process, so the link is correct. I don't see a better way to link, @michaelni would you have a suggestion here about how to improve this description?


I think that no modification is necessary here, and all other issues are fixed, please review again.

ffv1.md Outdated
return get_bits(bits) + 11
}
```
Figure: A pseudo-code description of the read of an unsigned integer in Golomb Rice mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other Figure labels are terminated with ., I suggest that here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other Figure labels are terminated with ., I suggest that here too.

Fixed

ffv1.md Outdated
}
```
Figure: A pseudo-code description of the read of a signed integer in Golomb Rice mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other Figure labels are terminated with ., I suggest that here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other Figure labels are terminated with ., I suggest that here too.

Fixed

ffv1.md Outdated
int get_ur_golomb(k) {
for (prefix = 0; prefix < 12; prefix++) {
if (get_bits(1)) {
return get_bits(k) + (prefix << k)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a ; to make the pseudo-compiler happy? (also at 613; it’s done at 621-622)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a ; to make the pseudo-compiler happy? (also at 613; it’s done at 621-622)

Modified (not "fixed" because it was in the current version :-p).

@michaelni michaelni merged commit 22dc258 into FFmpeg:master Jun 23, 2020
@JeromeMartinez JeromeMartinez deleted the SampleDifference branch June 23, 2020 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants