[FFmpeg-devel] Making intreadwrite.h public

Måns Rullgård mans
Fri Jul 9 23:55:20 CEST 2010


If we are to install intreadwrite.h as a public header, these are the
issues we must solve:

- bswap.h
  intreadwrite.h needs bswap.h, which is not a public header.  We
  could make it public, providing only unoptimised versions, if we
  rename all the macros with av_ prefixes.  They currently clash with
  glibc's byteswap.h so there would be a very real problem installing
  it as is.  I would take this opportunity to normalise the names of
  these macros a bit as well.  There is some confusion at the moment
  between ME (machine endian) in bswap.h and NE (native endian) in
  intreadwrite.h (and elsewhere).  I suggest unifying on NE.

- HAVE_ATTRIBUTE_PACKED
  Support for __attribute__((packed)) is detected by configure since
  there compilers which lie about being gcc and do not in fact support
  this attribute.  Though I hate to do this, we could add more ifdefs
  to check for these compilers as well (I know only of the TI compilers).

- HAVE_FAST_UNALIGNED
  This is set depending on the configured CPU.  As it is compiler-
  independent, it could be safely added to the installed avconfig.h.

- Performance
  The installed header cannot have access to the arch-optimised versions
  of the macros.  This is because they use compiler-dependent features,
  and installed headers must work with any compiler.  As a result,
  performance when using the installed header will not be quite as good
  as when used within ffmpeg.

If there are no objections to the above, I will go ahead and make the
necessary changes.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list