简体   繁体   English

x264编码器和图像色彩空间类型是否必须相同?

[英]Do the x264 encoder and image colorspace types need to be the same?

Do the i_csp fields in x264_image_t and x264_param_t have to be the same? x264_image_tx264_param_ti_csp字段必须相同吗? What happens if they aren't the same? 如果它们不相同怎么办?

They don't need to be exactly the same but they should be of the same subsampling (4:2:0/4:2:2/4:4:4). 它们不需要完全相同,但是应该具有相同的子采样(4:2:0/4:2:2/4:4:4)。 That is because libx264 wouldn't make real colorspace conversions but only change memory layout internally to NV12/NV16/I444. 这是因为libx264不会进行真正的色彩空间转换,而只会在内部将内存布局更改为NV12 / NV16 / I444。

So if you set x264_param_t.i_csp to X264_CSP_I420 you can set x264_image_t.i_csp to any from X264_CSP_I420, X264_CSP_YV12, X264_CSP_NV12, X264_CSP_NV21. 因此,如果将x264_param_t.i_csp设置为X264_CSP_I420,则可以将x264_image_t.i_csp设置为X264_CSP_I420,X264_CSP_YV12,X264_CSP_NV12,X264_CSP_NV21。

And if you set x264_param_t.i_csp to X264_CSP_I444 you can set x264_image_t.i_csp to any from X264_CSP_I444, X264_CSP_YV24 and even X264_CSP_BGR, X264_CSP_BGRA, X264_CSP_RGB but than you will need to correctly set i_colmatrix/b_fullrange yourself or better use X264_CSP_BGR for x264_param_t.i_csp. 如果将x264_param_t.i_csp设置为X264_CSP_I444,则可以将x264_image_t.i_csp设置为X264_CSP_I444,X264_CSP_YV24甚至X264_CSP_BGR,X264_CSP_BGRA,X264_CSP_m_B_C_t_c_range_x_c_range或X264_CSP_R_C_range_x_sp_x_sp_math_b或264_csp_b_sp_math_b,但您需要自己正确地设置i / b。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM