[go: nahoru, domu]

Revert "media/gpu: Support VP9 resolution changes to smaller w/o dropping ref frames"

This reverts commit 2c14d4b2f528aacadfe4e48740a733141b9ece4c.

Reason for revert: Started regression tracked in b:262058997

Original change's description:
> media/gpu: Support VP9 resolution changes to smaller w/o dropping ref frames
>
> VA-API VideoDecoders support resolution changes mid-stream to smaller
> (without a keyframe), however VP9Decoder thinks this is not supported
> and drops all the reference frames, causing some WebM test vector
> MD5SUMs to fail.
>
> This CL adds a parameter to VP9Decoder to avoid dropping said reference
> frames when the resolution change is to a smaller one, and sets it to
> true from VaapiVideoDecoder only.
>
> Tested on Intel (TGL volteer) and AMD (guybrush).
>
> Bug: b:207057398
> Change-Id: I21c50795ba26732b91563255330d79eb1168835d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4032552
> Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
> Commit-Queue: Miguel Casas-Sanchez <mcasas@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1074245}

Bug: b:207057398
Change-Id: I39ccf0239b8a2202de27fa14934cff451eab4d72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4205690
Reviewed-by: Miguel Casas-Sanchez <mcasas@chromium.org>
Commit-Queue: Miguel Casas-Sanchez <mcasas@chromium.org>
Auto-Submit: Drew Davenport <ddavenport@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1098997}
diff --git a/media/gpu/vp9_decoder.cc b/media/gpu/vp9_decoder.cc
index 202c3d0..7d9fcbb 100644
--- a/media/gpu/vp9_decoder.cc
+++ b/media/gpu/vp9_decoder.cc
@@ -113,12 +113,9 @@
 
 VP9Decoder::VP9Decoder(std::unique_ptr<VP9Accelerator> accelerator,
                        VideoCodecProfile profile,
-                       const VideoColorSpace& container_color_space,
-                       bool ignore_resolution_changes_to_smaller)
+                       const VideoColorSpace& container_color_space)
     : state_(kNeedStreamMetadata),
       container_color_space_(container_color_space),
-      ignore_resolution_changes_to_smaller_(
-          ignore_resolution_changes_to_smaller),
       // TODO(hiroh): Set profile to UNKNOWN.
       profile_(profile),
       accelerator_(std::move(accelerator)),
@@ -294,19 +291,11 @@
     }
 
     DCHECK(!new_pic_size.IsEmpty());
-
-    const bool is_pic_size_different = new_pic_size != pic_size_;
-    const bool is_pic_size_larger = new_pic_size.width() > pic_size_.width() ||
-                                    new_pic_size.height() > pic_size_.height();
-    const bool is_new_configuration_different_enough =
-        (ignore_resolution_changes_to_smaller_ ? is_pic_size_larger
-                                               : is_pic_size_different) ||
-        new_profile != profile_ || curr_frame_hdr_->bit_depth != bit_depth_;
-
-    if (is_new_configuration_different_enough) {
+    if (new_pic_size != pic_size_ || new_profile != profile_ ||
+        curr_frame_hdr_->bit_depth != bit_depth_) {
       DVLOG(1) << "New profile: " << GetProfileName(new_profile)
-               << ", new resolution: " << new_pic_size.ToString()
-               << ", new bit depth: "
+               << ", New resolution: " << new_pic_size.ToString()
+               << ", New bit depth: "
                << base::strict_cast<int>(curr_frame_hdr_->bit_depth);
 
       if (!curr_frame_hdr_->IsKeyframe() &&