libyami icon indicating copy to clipboard operation
libyami copied to clipboard

Continue the encoding even when the bit_stream length of coded buffer is zero

Open yakuizhao opened this issue 7 years ago • 8 comments

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.

yakuizhao avatar Mar 23 '17 07:03 yakuizhao

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.

sreerenjb avatar Mar 23 '17 17:03 sreerenjb

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.

yakuizhao avatar Mar 24 '17 00:03 yakuizhao

VME only returns motion vectors and macroblock code in separate buffers(we will define new types), not as CodedBuffer.

sreerenjb avatar Mar 24 '17 00:03 sreerenjb

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?

yakuizhao avatar Mar 24 '17 01:03 yakuizhao

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.

sreerenjb avatar Mar 24 '17 01:03 sreerenjb

Yakuizhao, yes it make sense :)

sreerenjb avatar Mar 24 '17 01:03 sreerenjb

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.

  1. va return value and
  2. coded_buffer size.

xuguangxin avatar Mar 24 '17 03:03 xuguangxin

and it may have diffrent logical when we have FEI... So driver handle this maybe better.

xuguangxin avatar Mar 24 '17 03:03 xuguangxin