Commit f0e7045f authored by Miguel Casas's avatar Miguel Casas Committed by Commit Bot

Vaapi: Activate |decode_using_client_picture_buffers_| for h264

This CL cleans up and activates |decode_using_client_picture_buffers_|
after recent power consumption measurements done by the Intel folks
reveal that there should be no regression, and also because skipping
the Vpp has a huge impact in memory consumption since Va doesn't need
to allocate ~13/14 Buffer Objects inside (see crbug.com/909926).

Bug: 909926, 822346
Change-Id: Ie8d6b41521f5d8ee62568f9674ae071a67c290bf
Reviewed-on: https://chromium-review.googlesource.com/c/1356019Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612498}
parent 90bb4ae3
...@@ -92,6 +92,16 @@ bool IsGeminiLakeOrLater() { ...@@ -92,6 +92,16 @@ bool IsGeminiLakeOrLater() {
cpuid.model() >= kGeminiLakeModelId; cpuid.model() >= kGeminiLakeModelId;
return is_geminilake_or_later; return is_geminilake_or_later;
} }
// Decides if the current platform and profile may decode using the client's
// PictureBuffers, or engage the Vpp to adapt VaApi's and the client's format.
bool ShouldDecodeOnclientPictureBuffers(bool has_va_surface_ids,
VideoCodecProfile profile) {
return has_va_surface_ids && (IsKabyLakeOrLater() || IsGeminiLakeOrLater()) &&
(profile == VP9PROFILE_PROFILE0 ||
(profile >= H264PROFILE_BASELINE && profile <= H264PROFILE_HIGH));
}
} // namespace } // namespace
#define RETURN_AND_NOTIFY_ON_FAILURE(result, log, error_code, ret) \ #define RETURN_AND_NOTIFY_ON_FAILURE(result, log, error_code, ret) \
...@@ -631,9 +641,7 @@ void VaapiVideoDecodeAccelerator::AssignPictureBuffers( ...@@ -631,9 +641,7 @@ void VaapiVideoDecodeAccelerator::AssignPictureBuffers(
} }
decode_using_client_picture_buffers_ = decode_using_client_picture_buffers_ =
!va_surface_ids.empty() && ShouldDecodeOnclientPictureBuffers(!va_surface_ids.empty(), profile_);
(IsKabyLakeOrLater() || IsGeminiLakeOrLater()) &&
profile_ == VP9PROFILE_PROFILE0;
// If we have some |va_surface_ids|, use them for decode, otherwise ask // If we have some |va_surface_ids|, use them for decode, otherwise ask
// |vaapi_wrapper_| to allocate them for us. // |vaapi_wrapper_| to allocate them for us.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment