Bug 1409105 - Downsample av1 images unconditionally. r?kinetik draft
authorRalph Giles <giles@mozilla.com>
Tue, 17 Oct 2017 12:24:50 -0700
changeset 681720 9a41cbdecf4236c7a03c749689b0b51d73875f9a
parent 681681 7b75416fb54c6733b7403e340457007658c42c14
child 736231 58332d69f265b1f0269ab2dcc1f44b842e746ddd
push id84920
push userbmo:giles@thaumas.net
push dateTue, 17 Oct 2017 19:33:10 +0000
reviewerskinetik
bugs1409105
milestone58.0a1
Bug 1409105 - Downsample av1 images unconditionally. r?kinetik Adding partial support for 10/12-bit video images seems to have broken the native pixel-stride support we were using to pass 8-bit AV1 frame data formatted in 16-bit pixel values, resulting in vertical green lines. Revert to the earlier behaviour of always downsampling to 8 bit data. This is slower for the demo stream, but at least displays correctly. MozReview-Commit-ID: 8kSd9kph9DE
dom/media/platforms/agnostic/AOMDecoder.cpp
--- a/dom/media/platforms/agnostic/AOMDecoder.cpp
+++ b/dom/media/platforms/agnostic/AOMDecoder.cpp
@@ -188,18 +188,18 @@ AOMDecoder::ProcessDecode(MediaRawData* 
   aom_codec_iter_t iter = nullptr;
   aom_image_t *img;
   UniquePtr<aom_image_t, AomImageFree> img8;
   DecodedData results;
 
   while ((img = aom_codec_get_frame(&mCodec, &iter))) {
     // Track whether the underlying buffer is 8 or 16 bits per channel.
     bool highbd = bool(img->fmt & AOM_IMG_FMT_HIGHBITDEPTH);
-    if (img->bit_depth > 8) {
-      // Downsample images with more than 8 significant bits per channel.
+    if (highbd) {
+      // Downsample images with more than 8 bits per channel.
       aom_img_fmt_t fmt8 = static_cast<aom_img_fmt_t>(img->fmt ^ AOM_IMG_FMT_HIGHBITDEPTH);
       img8.reset(aom_img_alloc(NULL, fmt8, img->d_w, img->d_h, 16));
       if (img8 == nullptr) {
         LOG("Couldn't allocate bitdepth reduction target!");
         return DecodePromise::CreateAndReject(
           MediaResult(NS_ERROR_OUT_OF_MEMORY,
                       RESULT_DETAIL("Couldn't allocate conversion buffer for AV1 frame")),
                       __func__);