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

Fixed NV21 Video Pixel Format #2

Open
vice opened this issue Aug 21, 2017 · 3 comments
Open

Fixed NV21 Video Pixel Format #2

vice opened this issue Aug 21, 2017 · 3 comments

Comments

@vice
Copy link

vice commented Aug 21, 2017

videoInput.fmt = AMVENC_NV21;

Could it be useful as a function parameter?
It makes more sense to have vl_img_format_t img_format parameter in vl_video_encoder_encode instead of vl_video_encoder_init function. See issue #1.

@OtherCrashOverride
Copy link
Owner

The codec hardware only supports NV21. Since there is currently no other choice, the value is hardcoded by Amlogic.

@vice
Copy link
Author

vice commented Aug 22, 2017

I have no problem with this but when I tested c2enc with NV12 as you said U and V values where swapped so I checked code and found that this value was fixed in the library.

I compiled a libvpcodec.so version with AMVENC_NV21 replaced with AMVENC_NV12 and with it c2enc encodes NV12 frames correctly. Also I found both versions perform equally.

NV12 format is more usual. I suppose hardware supports at least NV12 and NV21 pixel format.

@OtherCrashOverride
Copy link
Owner

The difference in NV12 and NV21 is the order of UV data: UV vs VU. My statement about "no other choice" was referring to different color formats such as YUV420 (3 planes), RGB, etc.

Exposing NV12/NV21 would be helpful in circumstances where the source data order can not be changed. Currently, data sources that I have tested offer both so there is no need for the feature.

As mentioned in #1, this library is expected to become obsolete when Amlogic mainlines codec support.

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