I am encoding jpeg image using Nvidia Jpeg Encoder NvJPEGEncoder::encodeFromFd() using fd received from Nvidia converter and I am seeing a strange effect. If I am encoding 1280 x 720 image then everything is perfect. However, if I encode 1920 x 1080, than a few bottom pixel rows are cut and the whole image is stretched vertically to fill 1080 height. Encoding H264 video using same fds received from Nvidia converter is fine in both resolutions, no cropping and stretching.
Do you know what is going on? Our system is TX1 R24.2.
I also noticed some other issues related to jpeg decoding/encoding. For example decoding jpeg image 4000x3000 to fd and then encoding it from fd produces jpeg image of 4000x3008. Also decoding YUV422 to fd and then encoding from fd produces wrong colors (as if color planes are flipped vertically). Very strange.
This is not exactly the case. In our case the problematic fd is not from camera but either from jpeg decoder or converter. Our cases are:
We take 1920x1080 rgb image in CPU memory which is fed to converter to create YUV420. Resulting fd is used for jpeg encoding. We see bottom cropped.
We take 4000x3000 YUV420 jpeg image and jpeg decode to fd. Resulting fd is used for jpeg encoding. We see that 4000x3008 image is created by encoder. Another issue (not important as we can easily work around it): if we take YUV422 input jpeg image then output jpeg image has colors messed up.
The following simple code demonstrates #2 (both issues if you feed YUV422 input image). Could you please try it?
The product is not released yet but we cannot do updates because we use specific camera sensor from 3rd party and the only driver available at the moment is for R24.2.1 So upper management made a decision to go to release with that version and we (dev) have to make it work :-(
Were you able to reproduce the issue in R24.2.3 or R28.2 using the code I sent earlier?