h264: fixed logic in decode frame
refactor: make use of bitops plus various fixes
typo
refactor and cleanup