-
Notifications
You must be signed in to change notification settings - Fork 303
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
[RFC]: Deprecate VA_ENC_PACKED_HEADER_NONE and similar #178
Comments
VA_ATTRIB_NOT_SUPPORTED and VA_ENC_PACKED_HEADER_NONE means have a little different meanings, VA_ATTRIB_NOT_SUPPORTED means the corresponding attribute is not supported at all however VA_ENC_PACKED_HEADER_NONE means packed header isn't required from application. |
Haihao's description above helps to clarify the usage and purpose for each flag a bit more. Since the purpose is subtle, it will be helpful if the usage for each flag is clearly documented to minimize ambiguity and misinterpretation. :)) I suggest checking both flags in succession. In other words, check the flag which supersedes the other, and based on the evaluation result, make the determine whether or not to check the subordinate flag. So for instance, assuming that VA_ATTRIB_NOT_SUPPORTED supersedes VA_ENC_PACKED_HEADER_NONE (i.e. VA_ENC_PACKED_HEADER_NONE is one of the attributes and is subordinate to VA_ATTRIB_NOT_SUPPORTED), verify whether the ambiguity can be resolved by evaluating VA_ATTRIB_NOT_SUPPORTED as a qualifier BEFORE evaluating VA_ENC_PACKED_HEADER_NONE in two successive "if" conditional statements. |
@xhaihao, that's quite the contrary to how Line 841 in 71fd9ec
@MicheleL-Intel, that is exactly the problem... apps and/or drivers are forced to handle it correctly with extra logic that would otherwise be unnecessary if VA_ENC_PACKED_HEADER_NONE != 0. And given that the documentation essentially says it means the same as VA_ATTRIB_NOT_SUPPORTED, that is why apps/middleware don't usually do the right thing. So, either it should be deprecated or the definition changed to non-zero value with better documentation. Honestly, I would actually prefer the latter. |
@uartie I agree the two flags and the comments make thing messy. The corresponding attribute value should be set to VA_ATTRIB_NOT_SUPPORTED if the attribute is not applicable, other values shouldn't indicate non-supported attribute.
I prefer deprecating VA_ENC_PACKED_HEADER_NONE because redefining VA_ENC_PACKED_HEADER_NONE to a non-zero value will break binary compatibility. |
@xhaihao ok, I agree... deprecating is better. It probably makes sense to do an audit for other similar cases that suffer from the same semantic issues, too (e.g. VA_ENC_INTERLACED_NONE, VA_ENC_QUANTIZATION_NONE, VA_ENC_INTRA_REFRESH_NONE, etc.). Those could be deprecated at the same time. |
@XinfengZhang do you have any input about this RFC for iHD driver? |
For the return value from I'm not sure that the specific macro |
If an attribute is not supported at all, does it make sense to pass this attribute to the driver ? I think it will confuse the user. |
@fhvwy libavcodec discards all VA_ATTRIB_NOT_SUPPORTED attributes returned by |
@uartie As long as we are clear that zero is still a valid value to pass for |
It's up to the driver to decide if zero is a valid value or not. If the driver reports to the program/client that the attribute is unsupported, then the client should comply. Otherwise, it's a bug in the client program. Clients should not make any assumptions about the driver implementation. This has nothing to do with API/ABI compatibility. If we deprecate/remove VA_ENC_PACKED_HEADER_NONE, then yes it's an API/ABI change. |
@fhvwy hmmm... on the other hand, maybe you're saying that the user is not required to send packed header when they "are supported" (which would imply |
Maybe there actually need to be two different fields here - the set of packed headers which are supported (that is, the user may optionally provide them but the encoder can work without them), and the set of packed headers which are required (that is, the user must provide them and the encoder will not work without them)? (I think some of the discussion here has been confusing the two cases, as VAAPI does not currently distinguish between them. I have always been talking about the first of the two (optional headers), where signalling that you are not going to provide them (passing zero or |
Yes, this is essentially what the other proposed option was intended to address (#178 (comment)). That is, change |
Driver should allow 0x0 (i.e. VA_ENC_PACKED_HEADER_NONE) value for the VAConfigAttribEncPackedHeaders attribute during vaCreateConfig when the attribute is supported. This test supercedes intel/intel-vaapi-driver#361 Also see intel/intel-vaapi-driver#358 and intel/libva#178 Signed-off-by: U. Artie Eoff <[email protected]>
…ue set to 0 Recent Intel i965 driver commit strictly disallows application to set unsupported attribute values, VA_ENC_PACKED_HEADER_NONE (0) is not used in Intel i965 driver, so application shouldn't pass this value to the driver. On the other hand, VA_ENC_PACKED_HEADER_NONE (0) means the driver doesn't support any packed header mode, so application also shouldn't pass packed header to driver if a driver returns VA_ENC_PACKED_HEADER_NONE (0), the driver should work without VAConfigAttribEncPackedHeaders set for this case. In addition, VA_ATTRIB_NOT_SUPPORTED and VA_ENC_PACKED_HEADER_NONE make thing messy, we will deprecate VA_ENC_PACKED_HEADER_NONE in the future. See intel/libva#178 for more information. This fixes broken vp9 encoder on Kably Lake with Intel I965 driver. Signed-off-by: Haihao Xiang <[email protected]>
…ue set to 0 Recent Intel i965 driver commit strictly disallows application to set unsupported attribute values, VA_ENC_PACKED_HEADER_NONE (0) is not used in Intel i965 driver, so application shouldn't pass this value to the driver. On the other hand, VA_ENC_PACKED_HEADER_NONE (0) means the driver doesn't support any packed header mode, so application also shouldn't pass packed header to driver if a driver returns VA_ENC_PACKED_HEADER_NONE (0), the driver should work without VAConfigAttribEncPackedHeaders set for this case. In addition, VA_ATTRIB_NOT_SUPPORTED and VA_ENC_PACKED_HEADER_NONE make thing messy, we will deprecate VA_ENC_PACKED_HEADER_NONE in the future. See intel/libva#178 for more information. This fixes broken vp9 encoder on Kably Lake with Intel I965 driver. Signed-off-by: Haihao Xiang <[email protected]>
…ue set to 0 Recent Intel i965 driver commit strictly disallows application to set unsupported attribute values, VA_ENC_PACKED_HEADER_NONE (0) is not used in Intel i965 driver, so application shouldn't pass this value to the driver. On the other hand, VA_ENC_PACKED_HEADER_NONE (0) means the driver doesn't support any packed header mode, so application also shouldn't pass packed header to driver if a driver returns VA_ENC_PACKED_HEADER_NONE (0), the driver should work without VAConfigAttribEncPackedHeaders set for this case. In addition, VA_ATTRIB_NOT_SUPPORTED and VA_ENC_PACKED_HEADER_NONE make thing messy, we will deprecate VA_ENC_PACKED_HEADER_NONE in the future. See intel/libva#178 for more information. This fixes broken vp9 encoder on Kably Lake with Intel I965 driver. Signed-off-by: Haihao Xiang <[email protected]>
…ue set to 0 Recent Intel i965 driver commit strictly disallows application to set unsupported attribute values, VA_ENC_PACKED_HEADER_NONE (0) is not used in Intel i965 driver, so application shouldn't pass this value to the driver. On the other hand, VA_ENC_PACKED_HEADER_NONE (0) means the driver doesn't support any packed header mode, so application also shouldn't pass packed header to driver if a driver returns VA_ENC_PACKED_HEADER_NONE (0), the driver should work without VAConfigAttribEncPackedHeaders set for this case. In addition, VA_ATTRIB_NOT_SUPPORTED and VA_ENC_PACKED_HEADER_NONE make thing messy, we will deprecate VA_ENC_PACKED_HEADER_NONE in the future. See intel/libva#178 for more information. This fixes broken vp9 encoder on Kably Lake with Intel I965 driver. Signed-off-by: Haihao Xiang <[email protected]>
Driver should allow 0x0 (i.e. VA_ENC_PACKED_HEADER_NONE) value for the VAConfigAttribEncPackedHeaders attribute during vaCreateConfig when the attribute is supported. This test supercedes intel/intel-vaapi-driver#361 Also see intel/intel-vaapi-driver#358 and intel/libva#178 Signed-off-by: U. Artie Eoff <[email protected]>
…ue set to 0 Recent Intel i965 driver commit strictly disallows application to set unsupported attribute values, VA_ENC_PACKED_HEADER_NONE (0) is not used in Intel i965 driver, so application shouldn't pass this value to the driver. On the other hand, VA_ENC_PACKED_HEADER_NONE (0) means the driver doesn't support any packed header mode, so application also shouldn't pass packed header to driver if a driver returns VA_ENC_PACKED_HEADER_NONE (0), the driver should work without VAConfigAttribEncPackedHeaders set for this case. In addition, VA_ATTRIB_NOT_SUPPORTED and VA_ENC_PACKED_HEADER_NONE make thing messy, we will deprecate VA_ENC_PACKED_HEADER_NONE in the future. See intel/libva#178 for more information. This fixes broken vp9 encoder on Kably Lake with Intel I965 driver. Signed-off-by: Haihao Xiang <[email protected]>
…ue set to 0 Recent Intel i965 driver commit strictly disallows application to set unsupported attribute values, VA_ENC_PACKED_HEADER_NONE (0) is not used in Intel i965 driver, so application shouldn't pass this value to the driver. On the other hand, VA_ENC_PACKED_HEADER_NONE (0) means the driver doesn't support any packed header mode, so application also shouldn't pass packed header to driver if a driver returns VA_ENC_PACKED_HEADER_NONE (0), the driver should work without VAConfigAttribEncPackedHeaders set for this case. In addition, VA_ATTRIB_NOT_SUPPORTED and VA_ENC_PACKED_HEADER_NONE make thing messy, we will deprecate VA_ENC_PACKED_HEADER_NONE in the future. See intel/libva#178 for more information. This fixes broken vp9 encoder on Kably Lake with Intel I965 driver. Signed-off-by: Haihao Xiang <[email protected]>
…ue set to 0 Recent Intel i965 driver commit strictly disallows application to set unsupported attribute values, VA_ENC_PACKED_HEADER_NONE (0) is not used in Intel i965 driver, so application shouldn't pass this value to the driver. On the other hand, VA_ENC_PACKED_HEADER_NONE (0) means the driver doesn't support any packed header mode, so application also shouldn't pass packed header to driver if a driver returns VA_ENC_PACKED_HEADER_NONE (0), the driver should work without VAConfigAttribEncPackedHeaders set for this case. In addition, VA_ATTRIB_NOT_SUPPORTED and VA_ENC_PACKED_HEADER_NONE make thing messy, we will deprecate VA_ENC_PACKED_HEADER_NONE in the future. See intel/libva#178 for more information. This fixes broken vp9 encoder on Kably Lake with Intel I965 driver. Signed-off-by: Haihao Xiang <[email protected]>
VAAPI provides two ways for drivers to report/handle some unsupported attributes. For example, driver can report that packed headers are unsupported by either setting the value to
VA_ATTRIB_NOT_SUPPORTED
orVA_ENC_PACKED_HEADER_NONE
. Unfortunately,VA_ENC_PACKED_HEADER_NONE
evaluates to zero (0) and can produce unintended results if not handled properly in both driver and middleware (since the packed header attribute is a bitfield).VA_ATTRIB_NOT_SUPPORTED
on the other hand is not zero and makes it suitable for simple bitwise operations on bitfield attributes. To handle both cases properly, drivers/middleware are forced to do extra work that would be unnecessary otherwise (e.g. https://github.com/intel/intel-vaapi-driver/blob/0b37282fa1c302d2b0c791fdc46c69af0d16d09b/src/i965_drv_video.c#L1418). AFAICT, having attribute values such asVA_ENC_PACKED_HEADER_NONE=0
serves no purpose and only creates confusion and bugs.Also, there are other bitfield attributes that have similar
_NONE = 0
usage which should also be deprecated.The text was updated successfully, but these errors were encountered: