You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.6 KiB
44 lines
1.6 KiB
https://bugs.chromium.org/p/aomedia/issues/detail?id=3487
|
|
https://aomedia.googlesource.com/aom/+/7029529477e1473e6eb7417538cea18edc5e3bd0
|
|
|
|
From 7029529477e1473e6eb7417538cea18edc5e3bd0 Mon Sep 17 00:00:00 2001
|
|
From: Wan-Teh Chang <wtc@google.com>
|
|
Date: Wed, 13 Sep 2023 10:55:05 -0700
|
|
Subject: [PATCH] Fix big-endian bugs in CodingPathSync tests
|
|
|
|
Change Serialize() to read uint16_t samples correctly. Although only the
|
|
least significant byte of each sample is nonzero, we cannot assume the
|
|
least significant byte of the c-th sample in `row` is row[c * 2]. That
|
|
is correct only on little-endian systems.
|
|
|
|
Bug: aomedia:3487
|
|
Change-Id: I9919ce6e3c877608ca7488fe4cc6957bcfe8c4cc
|
|
---
|
|
test/coding_path_sync.cc | 10 ++++++----
|
|
1 file changed, 6 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/test/coding_path_sync.cc b/test/coding_path_sync.cc
|
|
index c3e51fd565..31bc2d56b0 100644
|
|
--- a/test/coding_path_sync.cc
|
|
+++ b/test/coding_path_sync.cc
|
|
@@ -130,11 +130,13 @@ std::vector<int16_t> Serialize(const aom_image_t *img) {
|
|
|
|
for (int r = 0; r < h; ++r) {
|
|
for (int c = 0; c < w; ++c) {
|
|
- unsigned char *row = img->planes[plane] + r * img->stride[plane];
|
|
- if (img->fmt & AOM_IMG_FMT_HIGHBITDEPTH)
|
|
- bytes.push_back(row[c * 2]);
|
|
- else
|
|
+ const unsigned char *row = img->planes[plane] + r * img->stride[plane];
|
|
+ if (img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) {
|
|
+ const uint16_t *row16 = reinterpret_cast<const uint16_t *>(row);
|
|
+ bytes.push_back(row16[c]);
|
|
+ } else {
|
|
bytes.push_back(row[c]);
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
--
|
|
2.42.0
|