
BGRA RTCCVPixelBuffers were cropped and scaled incorrectly. Libyuv’s `ARGBScale` method is used in RTCCVPixelBuffer to scale and crop the pixel buffer. To crop by `cropX` and `cropY` pixels, pointer arithmetic is used to offset the src pointer of the original pixel buffer bytes. There is a bug in how this offset is calculated. The offset is done by `src += srcStride * _cropY + _cropX`. Libyuv expects that the src pointer will point to the start of a new pixel. However, if _cropX is a not a multiple of 4 (4 bytes for BGRA), the src pointer will point to a byte in the middle of a pixel and thus libyuv will incorrectly treat the data as the start of pixel (incorrectly treating the first byte as red when it is actually green, etc...). To fix this, the src pointer needs to be offset to always point to the start of a new pixel. Before this change: Original Test Gradient image with a cropX of 2: https://i.imgur.com/gSIgwGV.jpg Scaled image (notice the colors are incorrect): https://i.imgur.com/oPxbTEK.jpg After this change: Scaled image (notice the colors are correct): https://i.imgur.com/dqBsmsH.jpg A new unit test which tests scaling with cropX and cropY values has been added. The test fails without this change and now passes with the correct src pointer offsetting. Bug: webrtc:9555 Change-Id: I87cbd7b91bc139d51fb4e11cc50ccb014cfa8051 Reviewed-on: https://webrtc-review.googlesource.com/89220 Commit-Queue: Kári Helgason <kthelgason@webrtc.org> Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24076}
96 lines
3.3 KiB
Plaintext
96 lines
3.3 KiB
Plaintext
# Names should be added to this file like so:
|
|
# Name or Organization <email address>
|
|
|
|
Adam Fedor <adam.fedor@gmail.com>
|
|
Akshay Shah <meetakshay99@gmail.com>
|
|
Alexander Brauckmann <a.brauckmann@gmail.com>
|
|
Alexandre Gouaillard <agouaillard@gmail.com>
|
|
Andrew MacDonald <andrew@webrtc.org>
|
|
Anil Kumar <an1kumar@gmail.com>
|
|
Ben Strong <bstrong@gmail.com>
|
|
Bob Withers <bwit@pobox.com>
|
|
Bridger Maxwell <bridgeyman@gmail.com>
|
|
Chris Tserng <tserng@amazon.com>
|
|
Christophe Dumez <ch.dumez@samsung.com>
|
|
Cody Barnes <conceptgenesis@gmail.com>
|
|
Colin Plumb
|
|
David Porter <david@porter.me>
|
|
Dax Booysen <dax@younow.com>
|
|
Dmitry Lizin <sdkdimon@gmail.com>
|
|
Eric Rescorla, RTFM Inc. <ekr@rtfm.com>
|
|
Frederik Riedel, Frogg GmbH <frederik.riedel@frogg.io>
|
|
Giji Gangadharan <giji.g@samsung.com>
|
|
Graham Yoakum <gyoakum@skobalt.com>
|
|
Gustavo Garcia <gustavogb@gmail.com>
|
|
Hugues Ekra <hekra01@gmail.com>
|
|
Jake Hilton <jakehilton@gmail.com>
|
|
James H. Brown <jbrown@burgoyne.com>
|
|
Jan Kalab <pitlicek@gmail.com>
|
|
Jens Nielsen <jens.nielsen@berotec.se>
|
|
Jiawei Ou <jiawei.ou@gmail.com>
|
|
Jie Mao <maojie0924@gmail.com>
|
|
Luke Weber <luke.weber@gmail.com>
|
|
Maksim Khobat <maksimkhobat@gmail.com>
|
|
Mallikarjuna Rao V <vm.arjun@samsung.com>
|
|
Manish Jethani <manish.jethani@gmail.com>
|
|
Martin Storsjo <martin@martin.st>
|
|
Matthias Liebig <matthias.gcode@gmail.com>
|
|
Maxim Potapov <vopatop.skam@gmail.com>
|
|
Mike Gilbert <floppymaster@gmail.com>
|
|
Mo Zanaty <mzanaty@cisco.com>
|
|
Pali Rohar
|
|
Paul Kapustin <pkapustin@gmail.com>
|
|
Philipp Hancke <philipp.hancke@googlemail.com>
|
|
Peng Yu <yupeng323@gmail.com>
|
|
Rafael Lopez Diez <rafalopezdiez@gmail.com>
|
|
Ralph Giles <giles@ghostscript.com>
|
|
Riku Voipio <riku.voipio@linaro.org>
|
|
Robert Nagy <robert.nagy@gmail.com>
|
|
Ryan Yoakum <ryoakum@skobalt.com>
|
|
Satender Saroha <ssaroha@yahoo.com>
|
|
Sarah Thompson <sarah@telergy.com>
|
|
Saul Kravitz <Saul.Kravitz@celera.com>
|
|
Silviu Caragea <silviu.cpp@gmail.com>
|
|
Stefan Gula <steweg@gmail.com>
|
|
Steve Reid <sreid@sea-to-sky.net>
|
|
Tarun Chawla <trnkumarchawla@gmail.com>
|
|
Vladimir Beloborodov <VladimirTechMan@gmail.com>
|
|
Vicken Simonian <vsimon@gmail.com>
|
|
Victor Costan <costan@gmail.com>
|
|
Xiaohong Xu <freemine@yeah.net>
|
|
Xiaolei Yu <dreifachstein@gmail.com>
|
|
Yura Yaroshevich <yura.yaroshevich@gmail.com>
|
|
Hans Knoechel <hans@hans-knoechel.de>
|
|
Korniltsev Anatoly <korniltsev.anatoly@gmail.com>
|
|
Todd Wong <todd.wong.ndq@gmail.com>
|
|
Sergio Garcia Murillo <sergio.garcia.murillo@gmail.com>
|
|
Maxim Pavlov <pavllovmax@gmail.com>
|
|
Yusuke Suzuki <utatane.tea@gmail.com>
|
|
Piasy Xu <xz4215@gmail.com>
|
|
|
|
&yet LLC <*@andyet.com>
|
|
Agora IO <*@agora.io>
|
|
ARM Holdings <*@arm.com>
|
|
BroadSoft Inc. <*@broadsoft.com>
|
|
Facebook Inc. <*@fb.com>
|
|
Google Inc. <*@google.com>
|
|
HyperConnect Inc. <*@hpcnt.com>
|
|
Life On Air Inc. <*@lifeonair.com>
|
|
Intel Corporation <*@intel.com>
|
|
MIPS Technologies <*@mips.com>
|
|
Mozilla Foundation <*@mozilla.com>
|
|
Opera Software ASA <*@opera.com>
|
|
Optical Tone Ltd <*@opticaltone.com>
|
|
Sinch AB <*@sinch.com>
|
|
struktur AG <*@struktur.de>
|
|
Telenor Digital AS <*@telenor.com>
|
|
Temasys Communications <*@temasys.io>
|
|
The Chromium Authors <*@chromium.org>
|
|
The WebRTC Authors <*@webrtc.org>
|
|
Videxio AS <*@videxio.com>
|
|
Vonage Holdings Corp. <*@vonage.com>
|
|
Wire Swiss GmbH <*@wire.com>
|
|
Miguel Paris <mparisdiaz@gmail.com>
|
|
Vewd Software AS <*@vewd.com>
|
|
Highfive, Inc. <*@highfive.com>
|
|
CoSMo Software Consulting, Pte Ltd <*@cosmosoftware.io> |