AOMediaCodec / av1-rtp-spec

Current draft (HTML): https://aomediacodec.github.io/av1-rtp-spec/
Other
63 stars 24 forks source link

Define bit order of active_decode_targets_bitmask #216

Closed murillo128 closed 3 years ago

murillo128 commented 3 years ago

Currently we only have the following regarding the active_decode_targets_bitmask format:

active_decode_targets_bitmask: contains a bitmask that indicates which decode targets are available for decoding. Bit i is equal to 1 if decode target i is available for decoding, 0 otherwise.

We need to specify which is dt is 0, lsb or msb. Currently chrome uses lsb (parsed as a int) and I use msb (reading bit by bit)

murillo128 commented 3 years ago

From @DanilChapovalov in https://bugs.chromium.org/p/webrtc/issues/detail?id=12148#c15

I looked at the operating_point_idc in the av1 main spec (https://aomediacodec.github.io/av1-spec/av1-spec.pdf)

To deduce it I looked at the operating_point_idc/OperatingPointIdc in the main spec: Simlarly to the active_decode_target_bitmask, operating_point_idc is read using f(n) function (see page 30) The text say that "Bit k is equal to 1 if temporal layer k should be decoded " (see page 113) which code interpret as "inTemporalLayer = (OperatingPointIdc >> temporal_id ) & 1" (see page 27) i.e. Bit k is least important bit, which is the last bit. f(n) mention that "The bits are read from high to low order." (page 23)

This way webrtc way of interpreting the bitmask is consistent, i.e. bits 1,1,1,1,1,1,0,0,1 imply that 2nd decode target is inactive.

I am ok with dt=0 being the lsb

StephenBotzko commented 3 years ago

Closed with PR #219