Opened 12 years ago Closed 11 years ago #1082 closed defect (fixed)Missing left shift on offset in merge evaluation in SAO
Description
merge_iOffset in TEncSampleAdaptiveOffset.cpp needs to be shifted left by m_auiSaoBitIncrease[channel] in saoComponentParamDist and sao2ChromaParamDist. Change History (4)comment:1 Changed 12 years ago by DefaultCC Plugin
comment:2 Changed 12 years ago by davidfcomment:3 Changed 11 years ago by karlsharman
Fixed in HM12.1 due to reworking of SAO. comment:4 Changed 11 years ago by davidf
Note: See
TracTickets for help on using
tickets. | This list contains all users that will be notified about changes made to this ticket. These roles will be notified: Reporter, Owner, Subscriber, Participant
|
I can confirm that this is an issue. It is related to contributions L0189 which reports a loss of expected benefit when coding an 8bit sequence at 10, 12 and 14 bits; and to J0335 which purportedly resolved the issue by adjusting the inverse quantisation of the luma SAO offset.
With SAO off the benefits progress as follows (to reduce clutter, i shall just show a single sequence). Anchor = --SAO=0 --InternalBitDepth=8
With SAO on, we find: Anchor = --SAO=1 --InternalBitDepth=8
NB, to address a question that has been asked before, in all cases, performance is higher when comparing --SAO=1 against --SAO=0 at the same internal bitdepth.
Previous bitstream examinations by Karl using the instrumented HM+Rext decoder have shown that the cause in loss of expected benefit occurs because SAO starts failing to merge with previous parameter sets.
Investigation has shown that in the vanilla HM, when computing the distortion for the merge decision, the quantised offset value is used instead of the inverse quantised one. This obviously has no effect for 8 and 10bit configurations as there is no quantisation. However for 12 and 14bit there is an effect. This seems to have been introduced in J0355 r2614.
After applying the fix in the enclosed patch, the performance becomes: Anchor = --SAO=1 --InternalBitDepth=8 (no-fix)
The following patch addresses the issue in the RExt branch:
source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp