Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this code neccessary if the input jpeg is already grayscale? #255

Open
ppoocde opened this issue Feb 12, 2019 · 4 comments
Open

Is this code neccessary if the input jpeg is already grayscale? #255

ppoocde opened this issue Feb 12, 2019 · 4 comments

Comments

@ppoocde
Copy link

ppoocde commented Feb 12, 2019

Dear All,

I am trying to understand processor.cc, specially the function bool Processor::ProcessJpegData().
I see an if statement to check if the input has cbcr colorspace HasYCbCrColorSpace().
And, before the function try to optimize the quantization table, I found the following code:
{
JPEGData jpg = jpg_in;
RemoveOriginalQuantization(&jpg, q_in);
OutputImage img(jpg.width, jpg.height);
img.CopyFromJpegData(jpg);
comparator_->Compare(img);
}
MaybeOutput(encoded_jpg);

My question is, if the above code neccessary if my input is always have ycbcr (non grayscale) and always yuv420? Because I also try to optimize the code for our own usage.

Thanks,

Sunny

@koboltzz
Copy link

Glad someone is still interested in this software (like I am! Don't expect any answer from anyone here). I only have one hint if you want to optimize the process: Try to further optimize the already optimized version at https://github.com/ianhuang-777/guetzli-cuda-opencl instead this one. I have to say the added '--c' command reduce processing time by ~30% which is great.
The cuda and opencl optimization works only till 6 MP big pictures. Anything bigger will abort the process so it's not usable.

Please let me know if you have any success in further optimizing guetzli.

@ppoocde
Copy link
Author

ppoocde commented Feb 13, 2019

thanks @koboltzz
I intend to optimize the code so that it can be easier for hardware engineer to translate the implementation into one of the hardware description language such as Verilog.
Do you know any active Guetzli forum or website that I can post any question ?

@koboltzz
Copy link

No since for the most people guetzli is too heavy to RAM and CPU, it's kinda dead. The only people that could help you are Google employees and they don't work on guetzli anymore.

@ppoocde
Copy link
Author

ppoocde commented Feb 14, 2019

thanks again I may have to spend more time to understand the code then.
Refer to my original question, assume we don't modify any parameter.
By default, params_.force_420 and params_.try_420 are set to false,
theforefore, the following for loop are always executed:
for (int downsample = force_420; downsample <= try_420; ++downsample) {

Therefore, the above code can be treated as redundant if we don't modify the parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants