Opened 8 years ago #1472 new defectDiff between specification and HM on palette coding
Description
In the last specification, palette_coding() is specified as below: palette_coding( x0, y0, nCbS ) {
...
PaletteRun = nCbS * nCbS − PaletteScanPos − 1
...
if( MaxPaletteIndex > 0 ) {
if ( CopyAboveIndicesFlag[ xC ][ yC ] == 0 )
remainingNumIndices − = 1
PaletteMaxRun = nCbS * nCbS − PaletteScanPos − 1 − remainingNumIndices − copy_above_indices_for_final_run_flag
if( remainingNumIndices > 0 || CopyAboveIndicesFlag[ xC ][ yC ] != copy_above_indices_for_final_run_flag )
if( PaletteMaxRun > 0 ) {
palette_run_prefix
if( ( palette_run_prefix > 1 ) && ( PaletteMaxRun != ( 1 << ( palette_run_prefix − 1 ) ) ) )
palette_run_suffix
}
}
...
}
When PaletteMaxRun is equal to 0, no palette_run_prefix is parsed. There is no inference rule for this syntax element.
It is set to default value: nCbS * nCbS − PaletteScanPos − 1; as specified above in the parsing.
What is the right value for PaletteRun when PaletteMaxRun is equal to 0:
or
In the same idea, the variable PaletteMaxRun is derived before checking the following condition: remainingNumIndices > 0 || CopyAboveIndicesFlag[ xC ][ yC ] != copy_above_indices_for_final_run_flag
However, when this condition is not verified, the variable PaletteMaxRun is not used and could violate the condition:
Indeed, it is possible to have PaletteMaxRun equal to -1 when these 3 conditions are filled:
This case appears especially in HM generated streams.
Is this case a legitimate one ? palette_coding( x0, y0, nCbS ) {
...
PaletteRun = nCbS * nCbS − PaletteScanPos − 1
...
if( MaxPaletteIndex > 0 ) {
if ( CopyAboveIndicesFlag[ xC ][ yC ] == 0 )
remainingNumIndices − = 1
if( remainingNumIndices > 0 || CopyAboveIndicesFlag[ xC ][ yC ] != copy_above_indices_for_final_run_flag ) {
PaletteMaxRun = nCbS * nCbS − PaletteScanPos − 1 − remainingNumIndices − copy_above_indices_for_final_run_flag
if( PaletteMaxRun > 0 ) {
palette_run_prefix
if( ( palette_run_prefix > 1 ) && ( PaletteMaxRun != ( 1 << ( palette_run_prefix − 1 ) ) ) )
palette_run_suffix
}
}
}
...
}
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
| ||||||||||||||||