Skip to content
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

Bitstream refactor / VC1Bitstream parser #11417

Merged
merged 1 commit into from Jan 16, 2017
Merged

Bitstream refactor / VC1Bitstream parser #11417

merged 1 commit into from Jan 16, 2017

Conversation

peak3d
Copy link
Contributor

@peak3d peak3d commented Jan 10, 2017

Implement VC1-Packet Bitstream parser

Motivation and Context

VC-1 in mkv container sometimes have only DTS but no PTS values.
AML decoder needs from time to time a safe PTS value wich will be set on I-Frames.

This PR implements both I-Frame detection and Recovery point detection.

How Has This Been Tested?

Separate test environment

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@FernetMenta
Copy link
Contributor

looks much cleaner now, thanks
(I have not looked at the details. I assume this has been tested and works)

@peak3d peak3d added Type: Cleanup non-breaking change which removes non-working or unmaintained functionality Type: Feature non-breaking change which adds functionality v18 Leia Component: Video labels Jan 11, 2017
@peak3d
Copy link
Contributor Author

peak3d commented Jan 11, 2017

jenkins build this please, please

break;
case 0x07:
rate = 60000.0 / 1001.0;
rate = 60.0f;

This comment was marked as spam.

This comment was marked as spam.

@peak3d
Copy link
Contributor Author

peak3d commented Jan 11, 2017

jenkins build this please

* <http://www.gnu.org/licenses/>.
*
*/

This comment was marked as spam.

This comment was marked as spam.

@peak3d
Copy link
Contributor Author

peak3d commented Jan 11, 2017

jenkins build this please

BitstreamStats.h
BitstreamWriter.cpp

This comment was marked as spam.

This comment was marked as spam.

@peak3d
Copy link
Contributor Author

peak3d commented Jan 11, 2017

jenkins build this please

Copy link
Member

@Rechi Rechi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you have moved BS_WL32 and BS_RB16 to other files you must include xbmc/utils/BitstreamReader.h in xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp and xbmc/utils/BitstreamWriter.h in xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp

int writer_le;
uint32_t bit_buf;
int bit_left;
uint8_t *buf, *buf_ptr, *buf_end;

This comment was marked as spam.

uint32_t bit_buf;
int bit_left;
uint8_t *buf, *buf_ptr, *buf_end;
int size_in_bits;

This comment was marked as spam.

uint32_t bit_buf;
int bit_left;
uint8_t *buf, *buf_ptr, *buf_end;
int size_in_bits;

This comment was marked as spam.

This comment was marked as spam.


i = (4 - nbytes) * 8 + offbits;

ret = ((ret << i) >> i) >> ((nbytes * 8) - nbits - offbits);

This comment was marked as spam.

@fritsch
Copy link
Member

fritsch commented Jan 14, 2017

What I wonder is: if a future android maintainer makes the transition to ffmpeg hwaccel for mediacodec this code would be obsolete? What are the plans here? Is there already an alliance of the willing that make up plans for that future after v17?

@MrMC
Copy link

MrMC commented Jan 15, 2017

ffmpeg/mediacodec needs much more improvement before DVDVideoCodecAndroidMediaCodec can be replaced. Same for VideoToolBox, close but not quite there. Too many missed corner cases.

@fritsch
Copy link
Member

fritsch commented Jan 15, 2017 via email

@MrMC
Copy link

MrMC commented Jan 15, 2017

/* TODO: implement surface handling */

@MrMC
Copy link

MrMC commented Jan 15, 2017

For videotoolbox, here are a few

  1. assumes h264 has only one PPS in extra data. There can be more.
  2. does not handle kVTInvalidSessionErr correctly and try to reset the session.
  3. does not use the correct destinationPixelBufferAttributes for pure surface.
  4. does not allow downs scaling at the decoder, needed for 4k/h264 on some devices as they just don't have the memory bandwidth.

@peak3d
Copy link
Contributor Author

peak3d commented Jan 15, 2017

jenkins build this please

@MrMC
Copy link

MrMC commented Jan 16, 2017

Nice refactor of bitstream utils.They will be useful to replace the current AC3/EAC3/DTS format probing.

@peak3d
Copy link
Contributor Author

peak3d commented Jan 16, 2017

jenkins build this please and don't stop with errors nobody want to see.

@peak3d
Copy link
Contributor Author

peak3d commented Jan 16, 2017

jenkins build this please (I know, it was my fault :-)

@peak3d
Copy link
Contributor Author

peak3d commented Jan 16, 2017

jenkins build this please

@peak3d peak3d merged commit d44d5d5 into xbmc:master Jan 16, 2017
@peak3d peak3d deleted the bitstream branch January 16, 2017 16:17
@MartijnKaijser MartijnKaijser modified the milestone: L 18.0-alpha1 Jan 20, 2017
@a3kov
Copy link

a3kov commented Apr 1, 2018

Are these improvements used in Kodi 18 alpha 1 ? I still get audio out of sync problem with most VC-1 files on Minix U9-H (amlogic s912)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Video Type: Cleanup non-breaking change which removes non-working or unmaintained functionality Type: Feature non-breaking change which adds functionality v18 Leia
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants