Closed Bug 1683108 Opened 5 years ago Closed 5 years ago

YCbCrUtils.cpp:263:22: error: ‘srcData’ was not declared in this scope; did you mean ‘aData’?

Categories

(Core :: Graphics, defect)

defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox84 --- unaffected
firefox85 --- unaffected
firefox86 --- fixed

People

(Reporter: petr.sumbera, Assigned: chunmin)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0

Steps to reproduce:

On Solaris SPARC (big endian) I got following build error:

g++ -std=gnu++17 -o Unified_cpp_gfx_ycbcr0.o -c  -I/builds/psumbera/FIREFOX/obj-sparc64-sun-solaris2.11/dist/stl_wrappers -I/builds/psumbera/FIREFOX/obj-sparc64-sun-solaris2.11/dist/system_wrappers -include /builds/psumbera/FIREFOX/config/gcc_hidden.h -fstack-protector-strong -DDEBUG=1 -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/builds/psumbera/FIREFOX/gfx/ycbcr -I/builds/psumbera/FIREFOX/obj-sparc64-sun-solaris2.11/gfx/ycbcr -I/builds/psumbera/FIREFOX/media/libyuv/libyuv/include -I/builds/psumbera/FIREFOX/obj-sparc64-sun-solaris2.11/dist/include -I/builds/psumbera/FIREFOX/obj-sparc64-sun-solaris2.11/dist/include/nspr -I/builds/psumbera/FIREFOX/obj-sparc64-sun-solaris2.11/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /builds/psumbera/FIREFOX/obj-sparc64-sun-solaris2.11/mozilla-config.h -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wduplicated-cond -Wimplicit-fallthrough -Wunused-function -Wunused-variable -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wno-error=deprecated-copy -Wformat -Wformat-overflow=2 -Wno-psabi -fno-sized-deallocation -fno-aligned-new -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -fno-omit-frame-pointer -funwind-tables  -MD -MP -MF .deps/Unified_cpp_gfx_ycbcr0.o.pp   Unified_cpp_gfx_ycbcr0.cpp
In file included from Unified_cpp_gfx_ycbcr0.cpp:2:
/builds/psumbera/FIREFOX/gfx/ycbcr/YCbCrUtils.cpp: In function ‘void mozilla::gfx::ConvertYCbCrToRGB(const mozilla::layers::PlanarYCbCrData&, const mozilla::gfx::SurfaceFormat&, const IntSize&, unsigned char*, int32_t)’:
/builds/psumbera/FIREFOX/gfx/ycbcr/YCbCrUtils.cpp:263:22: error: ‘srcData’ was not declared in this scope; did you mean ‘aData’?
  263 |                      srcData.mPicSize);
      |                      ^~~~~~~
      |                      aData
gmake[3]: *** [/builds/psumbera/FIREFOX/config/rules.mk:676: Unified_cpp_gfx_ycbcr0.o] Error 1

This is probably caused by: 1654462

Regressed by: 1654462
Has Regression Range: --- → yes

Any idea how to fix this please?

Flags: needinfo?(cchang)

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Graphics
Product: Firefox → Core

Following might be the resolution:

diff -r 897405be7266 gfx/ycbcr/YCbCrUtils.cpp
--- a/gfx/ycbcr/YCbCrUtils.cpp  Fri Jan 24 14:52:31 2020 +0100
+++ b/gfx/ycbcr/YCbCrUtils.cpp  Thu Dec 17 17:02:17 2020 +0100
@@ -247,6 +247,14 @@
                           yuvtype,
                           srcData.mYUVColorSpace);
   }
+
+#if MOZ_BIG_ENDIAN()
+  // libyuv makes endian-correct result, which needs to be swapped to BGRX
+  if (aDestFormat != SurfaceFormat::R5G6B5_UINT16)
+    gfx::SwizzleData(aDestBuffer, aStride, gfx::SurfaceFormat::X8R8G8B8,
+                     aDestBuffer, aStride, gfx::SurfaceFormat::B8G8R8X8,
+                     srcData.mPicSize);
+#endif
 }

 void ConvertYCbCrToRGB(const layers::PlanarYCbCrData& aData,
@@ -255,13 +263,6 @@
                        int32_t aStride) {
   ConvertYCbCrToRGBInternal(aData, aDestFormat, aDestSize, aDestBuffer,
                             aStride);
-#if MOZ_BIG_ENDIAN()
-  // libyuv makes endian-correct result, which needs to be swapped to BGRX
-  if (aDestFormat != SurfaceFormat::R5G6B5_UINT16)
-    gfx::SwizzleData(aDestBuffer, aStride, gfx::SurfaceFormat::X8R8G8B8,
-                     aDestBuffer, aStride, gfx::SurfaceFormat::B8G8R8X8,
-                     srcData.mPicSize);
-#endif

Will see if there is anything else...

Attached file Bug 1683108 - Fix typo

Fix a typo caused by Bug 1654462.

In Bug 1654462, we move the main logic of ConvertYCbCrToRGB to
ConvertYCbCrToRGBInternal and leave gfx::SwizzleData behind.
The gfx::SwizzleData needs a IntSize parameter to perform the task.
However, the initial parameter is from a variable that is moved from
ConvertYCbCrToRGB to ConvertYCbCrToRGBInternal. The IntSize
parameter represents the picture size (PlanarYCbCrData::mPicSize) of
the picture of the passed image data. which won't be changed after
ConvertYCbCrToRGBInternal is performed. Therefore, we can use the
original picture size of the image data to the gfx::SwizzleData. That
should do the same job as before.

Thanks for the catch!

The mistake was made here. The srcData is moved from ConvertYCbCrToRGB to ConvertYCbCrToRGBInternal. Fortunately, the srcData.mPicSize is same as aData.mPicSize, so we can use aData.mPicSize for gfx::SwizzleData instead.

Flags: needinfo?(cchang)
Assignee: nobody → cchang
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch

Set release status flags based on info from the regressing bug 1654462

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: