libyami
libyami copied to clipboard
Continue the encoding even when the bit_stream length of coded buffer is zero
Soemtimes the driver fails and the bit_stream length of coded_buffer is zero. Currently it will continue the subsequent encoding. In fact it will be better to return error and exit the encoding.
Once we have the FEI implementation in place for encoding, coded_buffer of zero size is perfectly valid if the middleware only requested for VME operation since the VME output only produce MVs and MB code.
I don't think that the zero length of coded buffer is reasonable even for FEI. If only VME is used under FEI, it still uses one buffer to indicate the buffer size of MV/MB code. In such case I think that the coded buffer still needs to return one valid buffer size.
VME only returns motion vectors and macroblock code in separate buffers(we will define new types), not as CodedBuffer.
If so, I think that it is an exception for VME in FEI scenario. In such case it can be distinguished by using the encoding entrypoint. If it is for FEI entrypoint, it will continue the subsequential operation even when the coded buffer length is zero. Otherwise it should return error and end the encoding operation. Does this make sense to you?
But of course, FEI mode can treat zero sized coded buffer as normal. Which means, all usual encode scenarios should error out if coded_buffer end up as zero size after vaEndPicture except FEI VME only mode.
Yakuizhao, yes it make sense :)
Since coded_buffer size equals 0 is not a validate result, could we return an error in driver? Just like underflow or overflow. Else middleware need check two things for error.
- va return value and
- coded_buffer size.
and it may have diffrent logical when we have FEI... So driver handle this maybe better.