-
Notifications
You must be signed in to change notification settings - Fork 10
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
Comments
The codec hardware only supports NV21. Since there is currently no other choice, the value is hardcoded by Amlogic. |
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. |
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. |
c2_vpcodec/libvpcodec.cpp
Line 139 in 355a7f4
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.
The text was updated successfully, but these errors were encountered: