Consider frame orientation for number of spatial layers in VP9.
Addresses case where 540*960 would not get a 135*240 layer. Bug: webrtc:13469 Change-Id: Icc291c65114fb400cc71659d76a786e359e5996c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239820 Reviewed-by: Sergey Silkin <ssilkin@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Konrad Hofbauer <hofbauer@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35507}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
70f445e592
commit
d2cd8722cd
@ -69,12 +69,15 @@ std::vector<SpatialLayer> ConfigureSvcNormalVideo(size_t input_width,
|
||||
std::vector<SpatialLayer> spatial_layers;
|
||||
|
||||
// Limit number of layers for given resolution.
|
||||
const bool is_landscape = input_width >= input_height;
|
||||
const size_t min_width = is_landscape ? kMinVp9SpatialLayerLongSideLength
|
||||
: kMinVp9SpatialLayerShortSideLength;
|
||||
const size_t min_height = is_landscape ? kMinVp9SpatialLayerShortSideLength
|
||||
: kMinVp9SpatialLayerLongSideLength;
|
||||
const size_t num_layers_fit_horz = static_cast<size_t>(std::floor(
|
||||
1 + std::max(0.0f,
|
||||
std::log2(1.0f * input_width / kMinVp9SpatialLayerWidth))));
|
||||
const size_t num_layers_fit_vert = static_cast<size_t>(
|
||||
std::floor(1 + std::max(0.0f, std::log2(1.0f * input_height /
|
||||
kMinVp9SpatialLayerHeight))));
|
||||
1 + std::max(0.0f, std::log2(1.0f * input_width / min_width))));
|
||||
const size_t num_layers_fit_vert = static_cast<size_t>(std::floor(
|
||||
1 + std::max(0.0f, std::log2(1.0f * input_height / min_height))));
|
||||
const size_t limited_num_spatial_layers =
|
||||
std::min(num_layers_fit_horz, num_layers_fit_vert);
|
||||
if (limited_num_spatial_layers < num_spatial_layers) {
|
||||
|
||||
Reference in New Issue
Block a user