intel / libyami

Yet Another Media Infrastructure. it is core part of media codec with hardware acceleration, it is yummy to your video experience on Linux like platform.
Apache License 2.0
146 stars 106 forks source link

mpeg2dec: refact, make code more readable. #872

Closed xuguangxin closed 5 years ago

xuguangxin commented 5 years ago

It done following improvements:

  1. do not handle m_VAStart and va context creation logical. it's should handle by the base class. We just need to use setFormat and ensureProfile in VaapiDecoderBase
  2. simplify the Nal Data parser logical, we do not need to check the same id in decoder and parser again and again.
  3. do not handle need codec data in start(), for mpeg2 we can get anything we need from the stream.
  4. simplify the dpb manager logical.
  5. simplify the IQ matrix logical.

compare to previous version of mpeg2 decoder/parser, 702 lines of code removed, but the conformance pass rate is the same.

xuguangxin commented 5 years ago

@wangzj0601 , please help review and run full round test. thanks

xuguangxin commented 5 years ago

@wangzj0601 , any update?

wangzj0601 commented 5 years ago

@xuguangxin , I'm running the regression tests, it always hang up on my dev unit, I will change a unit to run the tests, please wait for a moment, thanks.

xuguangxin commented 5 years ago

@wangzj0601 , updated, please help retest it. thanks

xuguangxin commented 5 years ago

thanks Zhanjun

uartie commented 5 years ago

This patch introduces a bunch of compiler errors. Please fix!

configure flags --enable-tests --enable-debug --enable-h264enc --enable-jpegenc --enable-vp8enc --enable-vp9enc --enable-h265enc --enable-h264dec --enable-jpegdec --enable-vp8dec --enable-vp9dec --enable-h265dec --enable-mpeg2dec --enable-vc1dec --disable-fakedec --disable-oclfilters --enable-dmabuf --enable-md5 --disable-egl --disable-v4l2 --disable-wayland

uartie commented 5 years ago

With compiler errors getting missed by testing, seems like test methodology is wrong.

uartie commented 5 years ago

Hint: --enable-debug

xuguangxin commented 5 years ago

@uartie sorry, the normal test may not compiled with --enable-debug... It's my mistake, not check the --enable-debug configuration. fixed at https://github.com/intel/libyami/pull/873, please help review it. thanks for capture this

uartie commented 5 years ago

@xuguangxin perhaps you could add additional configure & compile combinations to travis ci to catch these.

xuguangxin commented 5 years ago

@uartie , good suggestion. Done at https://github.com/intel/libyami/pull/874 thanks