-
Notifications
You must be signed in to change notification settings - Fork 167
decompressor_unexpected_chroma_sampling when transcoding image from CandyCam app. #8
Comments
Hey @MarsVard, thanks for rising the issue! I've been able to reproduce this by capturing an image with "Candy Camera" and decoding/transcoding with the sample Spectrum app. I've also downloaded the image to my development device and observed that it is using 4:1:1 chroma sub-sampling:
Our C++ code is incomplete regarding this particular sub-sampling mode of 4:1:1. It's also missing 4:4:0. The reason for this is that we didn't have evidence that these mode are practically used. This seems to be the case though and I'll try to push an update this week,. Code pointer of supported chroma sub-sampling to date: https://github.com/facebookincubator/spectrum/blob/master/cpp/spectrum/image/Specification.h#L23-L31 /**
* Chroma sampling describe the number of luma information per chroma
* information.
*/
enum class ChromaSamplingMode {
S444 = 0,
S420 = 1,
S422 = 2,
}; This is a super helpful information for us, thanks a lot for sharing! |
Summary: Adding support for 4:1:1 and 4:4:0 sub-sampling as discussed in #8 **Test plan** Followed the reproduction steps from the file with a file captured in 4:1:1 as input. Before: ``` SpectrumException{ name='decompressor_unexpected_chroma_sampling', message='decompressor_unexpected_chroma_sampling', location='image::ChromaSamplingMode facebook::spectrum::plugins::jpeg::LibJpegDecompressor::_chromaSamplingMode():103', ... ``` After: ``` SpectrumResult{ ruleName='base', inputImageSpecification=ImageSpecification{size=ImageSize{width=1431, height=2688}, format=jpeg, pixelSpecification=ImagePixelSpecification{colorModel=RGB, bytesPerPixel=3, alphaInfo=NONE, componentsOrder=NATURAL}, orientation=UP, chromaSamplingMode=S411, metadata=ImageMetadata{}}, outputImageSpecification=ImageSpecification{size=ImageSize{width=533, height=1000}, format=jpeg, pixelSpecification=ImagePixelSpecification{colorModel=RGB, bytesPerPixel=3, alphaInfo=NONE, componentsOrder=NATURAL}, orientation=UP, chromaSamplingMode=S420, metadata=ImageMetadata{}}, totalBytesRead=1854587, totalBytesWritten=58664 } ``` Reviewed By: cuva Differential Revision: D13233286 fbshipit-source-id: 408cf5f74a6c1dedefa35b92449923e3c73b8dc6
Fixed in master by d36ba0e and will be going out with the next release :) |
That's fast! Awesome! |
This is fixed with the 1.0.0 release: https://github.com/facebookincubator/spectrum/releases/tag/v1.0.0 Closing :) |
I'm not sure if it's a specific issue with their app or if something is missing from this library. But I noticed this in my user base.
I will update this thread as soon as I have more information.
The text was updated successfully, but these errors were encountered: