-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix exit_symbol() requirement of bitstream conformance
- Loading branch information
chai51
committed
Nov 27, 2024
1 parent
fc3f455
commit 799beca
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
799beca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requirement of bitstream conformance that the bit at position trailingBitPosition is equal to 1. [1] The variable trailingBitPosition is set equal to get_position() - Min(14, SymbolMaxBits+14).
[1] https://aomedia.googlesource.com/aom/+/refs/heads/main/aom_dsp/entdec.c , trace variable dec->tell_offs
799beca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @chai51,
Thank you for the proposed change. I am not familiar this part of the AV1 specification. I worked out two examples where there are no encoded symbols in the input, the input consists of trailing bits only.
Assume
get_position()
is initiallly 0.Example 1:
In
init_symbol(sz=1)
,numBits
isMin(1 * 8, 15) = 8
.f(8)
is read, soget_position()
becomes 8.SymbolMaxBits
is8 * 1 - 15 = -7
.In
exit_symbol()
,get_position() - Min(15, SymbolMaxBits+15)
is8 - Min(15, -7+15) = 8 - 8 = 0
, which is the position of the 1 bit in the trailing bits.,Example 2:
In
init_symbol(sz=3)
,numBits
isMin(3 * 8, 15) = 15
.f(15)
is read, soget_position()
becomes 15.SymbolMaxBits
is8 * 3 - 15 = 9
.In
exit_symbol()
,get_position() - Min(15, SymbolMaxBits+15)
is15 - Min(15, 9+15) = 15 - 15 = 0
, which is the position of the 1 bit in the trailing bits.,So the
trailingBitPosition
definition in the spec,get_position() - Min(15, SymbolMaxBits+15)
, is correct for these two examples. Your proposed change,get_position() - Min(14, SymbolMaxBits+14)
, would be incorrect for these two examples.799beca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I misunderstood earlier. Thank you for your correction. Now the problem has been solved.