The current hardware-accelerated gstjpeg library on Jetson TX2 board with L4T R27 does not allow setting image quality in the jpeg encoding process, even though in the source code gstjpegenc.c there is a line:
I am not using Gstreamer in my application. Instead I am writing my own C/C++ code following examples given in the Multimedia API samples. Here is my code snippet:
// create JPEG encoder
g_JpegEncoder = NvJPEGEncoder::createJPEGEncoder("jpenenc");
...
// JPEG image encode
g_JpegEncoder->encodeFromFd(buffer->planes[0].fd, JCS_YCbCr, &g_Buffer, size);
// save JPEG image to a file
outputFile->write((char *)g_Buffer, size);
In this situation, how do I pass in the image quality in these functions calls? The Multimedia API documentation on NvJPEGEncoder Class does not expose image quality as a parameter.
I look forward to your answer to this question. Thanks for your help!
Your answer is exactly what I was trying to do in the first place: to modify NvJPEGEncoder class source code so that image quality is exposed as a function call parameter. However, I cannot even compile the original library, let alone modifying the source code!
Also, I have found NvJpegEncoder.h file, but I cannot find NvJpegEncoder.cpp source file. Where can I find this and other related source files?