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

H264EncoderNvcodec Module tests not giving correct outputs for Raw Planar Images #349

Open
kushaljain-apra opened this issue Apr 24, 2024 · 0 comments

Comments

@kushaljain-apra
Copy link
Collaborator

Describe the bug

  • H264EncoderNvcodec Module are not encoding the raw planar images correctly for images which have width <= 512
  • To check whether its a problem with H264EncoderNvcodec Module and ran the video-sdk-samples applications provided by Nvidia for testing out the Nvcodec Encoder/Decoder which provided the correct results
  • After comparing the results with the video-sdk-samples applications to test the Nvcodec Encoder, it was found that the step/pitch that is being calculated for the chroma planes (U and V plane) was half of the pitch/step of the Y plane, whereas in RawImagePlanarMetadata Class the implementation is to take half of the width of the image and add padding based on the alignment length
  • This causes the problem for images with width <= 512 because then in the RawImagePlanar metadata their step/pitch (because of the padding) will give you the value 512 (because alignment length is set to 512 in CudaMemCpy Module)
  • On changing the implementation to handle the metadata in RawImagePlanarMetadata Class, to what is described in video-sdk-samples resolves the issue (refer to Expected Output Screenshot) but we still don't know whether that is a correct solution or not.

To Reproduce
Steps to reproduce the behavior:

  1. Comment the TestUtils:FileCleaner and run the test "yuv420_640x360_resize".
  2. Open the saved file in testOutput folder, the output should be like the screenshot attached below.

Expected behavior
Expected behavior should be as in the Expected Output Screenshot attached below.

Screenshots
Current Output:
Screenshot from 2024-04-24 16-04-11

Expected Output:
Screenshot from 2024-04-24 16-04-41

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. chrome, safari]
  • Cuda Version [e.g. 22]
  • Architecture [e.g. x86_64, arm64]

Additional context
Add any other context about the problem here.

Would you like to work on the issue?
Please state if this issue should be assigned to you or who you think could help to solve this issue.

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

1 participant