New issue
Advanced search Search tips

Issue 891571 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[remoting] Remove quantizer from WebrtcVideoEncoder interface

Project Member Reported by lambroslambrou@chromium.org, Oct 3

Issue description

The encoder's "quantizer" property is specific to VP8/VP9 encoding. It doesn't make sense to expose this setting in the generic encoder interface.

Currently, WebrtcVideoEncoder::EncodedFrame struct has a "quantizer" field.

VP8/VP9 encoders set this field by getting the VP8E_GET_LAST_QUANTIZER_64 property from the encoder.
The GPU encoder always sets it to 0.
The CastSoftwareVideoEncoderAdapter always sets it to INT32_MAX, simply to trigger top-off logic in the scheduler.

It's reported in the frame stats, but we should update this to be a general measure of frame quality (for example: a score from 0-100 representing the amount of data retained, 100 being lossless).

The only other place it's used is in the video scheduler, for the top-off determination:
https://cs.chromium.org/chromium/src/remoting/protocol/webrtc_frame_scheduler_simple.cc?l=237&rcl=abd4bd5f00204398d59df86124c8004747eb6a1b

The video scheduler also sets quantizer levels manually (for VP8) when it detects big frames.

The encoder-specific top-up logic, and the big-frame handling, should be encapsulated inside the encoder somehow.

 
I think the original intention was to have a different frame-scheduler for each encoder? We currently have an interface, WebrtcFrameScheduler, with a single implementation, WebrtcFrameSchedulerSimple.

In any case, the generic scheduler interface and code should not have encoder-specific logic (such as frame-quantizer, top-up, big-frame detection). Such logic should somehow be moved to separate per-encoder classes. This will become important if we want to support other codecs such as AV1 and H264 hardware-decoding.

Sign in to add a comment