Message ID | 20171224044852.88559-2-misty@brew.sh |
---|---|
State | Superseded |
Headers | show |
On 24 December 2017 at 04:48, <misty@brew.sh> wrote: > From: Misty De Meo <mistydemeo@gmail.com> > > Most of the constants in libavcodec/oma aren't specific to > libavformat; moving them into libavcodec makes them available to > libavcodec as well as keeping them compatible with libavformat. > > ff_oma_codec_tags uses a libavformat-specific type, so it has been > left in libavformat. > --- > libavformat/oma.c => libavcodec/oma.h | 27 +++++++++++++-------------- > libavcodec/version.h | 2 +- > libavformat/Makefile | 4 ++-- > libavformat/oma.h | 21 +++++++++------------ > libavformat/omadec.c | 1 + > libavformat/omaenc.c | 1 + > libavformat/version.h | 2 +- > 7 files changed, 28 insertions(+), 30 deletions(-) > rename libavformat/oma.c => libavcodec/oma.h (65%) > > diff --git a/libavformat/oma.c b/libavcodec/oma.h > similarity index 65% > rename from libavformat/oma.c > rename to libavcodec/oma.h > index f7ae3c9948..176f93ed22 100644 > --- a/libavformat/oma.c > +++ b/libavcodec/oma.h > @@ -18,25 +18,22 @@ > * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA > 02110-1301 USA > */ > > +#ifndef AVCODEC_OMA_H > +#define AVCODEC_OMA_H > + > +#include <stdint.h> > + > #include "internal.h" > -#include "oma.h" > -#include "libavcodec/avcodec.h" > #include "libavutil/channel_layout.h" > > -const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0 }; > +#define EA3_HEADER_SIZE 96 > +#define ID3v2_EA3_MAGIC "ea3" > +#define OMA_ENC_HEADER_SIZE 16 > > -const AVCodecTag ff_oma_codec_tags[] = { > - { AV_CODEC_ID_ATRAC3, OMA_CODECID_ATRAC3 }, > - { AV_CODEC_ID_ATRAC3P, OMA_CODECID_ATRAC3P }, > - { AV_CODEC_ID_MP3, OMA_CODECID_MP3 }, > - { AV_CODEC_ID_PCM_S16BE, OMA_CODECID_LPCM }, > - { AV_CODEC_ID_ATRAC3PAL, OMA_CODECID_ATRAC3PAL }, > - { AV_CODEC_ID_ATRAC3AL, OMA_CODECID_ATRAC3AL }, > - { 0 }, > -}; > +static const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0 > }; > > /** map ATRAC-X channel id to internal channel layout */ > -const uint64_t ff_oma_chid_to_native_layout[7] = { > +static const uint64_t ff_oma_chid_to_native_layout[7] = { > AV_CH_LAYOUT_MONO, > AV_CH_LAYOUT_STEREO, > AV_CH_LAYOUT_SURROUND, > @@ -47,4 +44,6 @@ const uint64_t ff_oma_chid_to_native_layout[7] = { > }; > > /** map ATRAC-X channel id to total number of channels */ > -const int ff_oma_chid_to_num_channels[7] = {1, 2, 3, 4, 6, 7, 8}; > +static const int ff_oma_chid_to_num_channels[7] = {1, 2, 3, 4, 6, 7, 8}; > + > +#endif /* AVCODEC_OMA_H */ > diff --git a/libavcodec/version.h b/libavcodec/version.h > index d55de89797..d48857578d 100644 > --- a/libavcodec/version.h > +++ b/libavcodec/version.h > @@ -29,7 +29,7 @@ > > #define LIBAVCODEC_VERSION_MAJOR 58 > #define LIBAVCODEC_VERSION_MINOR 8 > -#define LIBAVCODEC_VERSION_MICRO 100 > +#define LIBAVCODEC_VERSION_MICRO 101 > > #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, > \ > LIBAVCODEC_VERSION_MINOR, \ > diff --git a/libavformat/Makefile b/libavformat/Makefile > index cb70eac920..ef0365e6e2 100644 > --- a/libavformat/Makefile > +++ b/libavformat/Makefile > @@ -358,8 +358,8 @@ OBJS-$(CONFIG_OGG_MUXER) += oggenc.o \ > vorbiscomment.o > OBJS-$(CONFIG_OGV_MUXER) += oggenc.o \ > vorbiscomment.o > -OBJS-$(CONFIG_OMA_DEMUXER) += omadec.o pcm.o oma.o > -OBJS-$(CONFIG_OMA_MUXER) += omaenc.o rawenc.o oma.o > id3v2enc.o > +OBJS-$(CONFIG_OMA_DEMUXER) += omadec.o pcm.o > +OBJS-$(CONFIG_OMA_MUXER) += omaenc.o rawenc.o id3v2enc.o > OBJS-$(CONFIG_OPUS_MUXER) += oggenc.o \ > vorbiscomment.o > OBJS-$(CONFIG_PAF_DEMUXER) += paf.o > diff --git a/libavformat/oma.h b/libavformat/oma.h > index 36fd0125e4..ccd57d779e 100644 > --- a/libavformat/oma.h > +++ b/libavformat/oma.h > @@ -21,14 +21,8 @@ > #ifndef AVFORMAT_OMA_H > #define AVFORMAT_OMA_H > > -#include <stdint.h> > - > #include "internal.h" > > -#define EA3_HEADER_SIZE 96 > -#define ID3v2_EA3_MAGIC "ea3" > -#define OMA_ENC_HEADER_SIZE 16 > - > enum { > OMA_CODECID_ATRAC3 = 0, > OMA_CODECID_ATRAC3P = 1, > @@ -39,11 +33,14 @@ enum { > OMA_CODECID_ATRAC3AL = 34, > }; > > -extern const uint16_t ff_oma_srate_tab[8]; > - > -extern const AVCodecTag ff_oma_codec_tags[]; > - > -extern const uint64_t ff_oma_chid_to_native_layout[7]; > -extern const int ff_oma_chid_to_num_channels[7]; > +static const AVCodecTag ff_oma_codec_tags[] = { > + { AV_CODEC_ID_ATRAC3, OMA_CODECID_ATRAC3 }, > + { AV_CODEC_ID_ATRAC3P, OMA_CODECID_ATRAC3P }, > + { AV_CODEC_ID_MP3, OMA_CODECID_MP3 }, > + { AV_CODEC_ID_PCM_S16BE, OMA_CODECID_LPCM }, > + { AV_CODEC_ID_ATRAC3PAL, OMA_CODECID_ATRAC3PAL }, > + { AV_CODEC_ID_ATRAC3AL, OMA_CODECID_ATRAC3AL }, > + { 0 }, > +}; > > #endif /* AVFORMAT_OMA_H */ > diff --git a/libavformat/omadec.c b/libavformat/omadec.c > index 423d52b3aa..ccefd6c1bc 100644 > --- a/libavformat/omadec.c > +++ b/libavformat/omadec.c > @@ -48,6 +48,7 @@ > #include "libavutil/intreadwrite.h" > #include "libavutil/des.h" > #include "libavutil/mathematics.h" > +#include "libavcodec/oma.h" > #include "oma.h" > #include "pcm.h" > #include "id3v2.h" > diff --git a/libavformat/omaenc.c b/libavformat/omaenc.c > index 7952808bf8..6e72c3ee85 100644 > --- a/libavformat/omaenc.c > +++ b/libavformat/omaenc.c > @@ -24,6 +24,7 @@ > #include "avio_internal.h" > #include "id3v2.h" > #include "internal.h" > +#include "libavcodec/oma.h" > #include "oma.h" > #include "rawenc.h" > > diff --git a/libavformat/version.h b/libavformat/version.h > index 5ced041f0a..6453d4559f 100644 > --- a/libavformat/version.h > +++ b/libavformat/version.h > @@ -33,7 +33,7 @@ > // Also please add any ticket numbers that you believe might be affected > here > #define LIBAVFORMAT_VERSION_MAJOR 58 > #define LIBAVFORMAT_VERSION_MINOR 3 > -#define LIBAVFORMAT_VERSION_MICRO 100 > +#define LIBAVFORMAT_VERSION_MICRO 101 > > #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, > \ > LIBAVFORMAT_VERSION_MINOR, > \ > -- > 2.15.1 > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > Code in header files which gets inlined doesn't need an ff_ prefix. Aside from that, patchset looks good to me.
From: Misty De Meo <mistydemeo@gmail.com> > Code in header files which gets inlined doesn't need an ff_ prefix. Sounds good! I've updated the patchset to strip the ff_ prefix from the oma consts from the headers. The full updated patchset is included. Maxim Poliakovski (1): mpeg: add experimental support for PSMF audio. Misty De Meo (5): oma: move some constants into libavcodec atrac3plus_parser: use libavcodec's oma Fix detecting ATRAC3 audio from MPS files mpeg: fix use of deprecated struct psmf: add FATE tests Changelog | 1 + libavcodec/Makefile | 1 + libavcodec/allcodecs.c | 1 + libavcodec/atrac3plus_parser.c | 153 ++++++++++++++++++++++++++++++++++ libavformat/oma.c => libavcodec/oma.h | 27 +++--- libavcodec/version.h | 2 +- libavformat/Makefile | 4 +- libavformat/mpeg.c | 15 ++++ libavformat/mpeg.h | 1 + libavformat/oma.h | 21 ++--- libavformat/omadec.c | 13 +-- libavformat/omaenc.c | 7 +- libavformat/version.h | 2 +- tests/Makefile | 1 + tests/fate/psmf.mak | 23 +++++ 15 files changed, 233 insertions(+), 39 deletions(-) create mode 100644 libavcodec/atrac3plus_parser.c rename libavformat/oma.c => libavcodec/oma.h (65%) create mode 100644 tests/fate/psmf.mak
diff --git a/libavformat/oma.c b/libavcodec/oma.h similarity index 65% rename from libavformat/oma.c rename to libavcodec/oma.h index f7ae3c9948..176f93ed22 100644 --- a/libavformat/oma.c +++ b/libavcodec/oma.h @@ -18,25 +18,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifndef AVCODEC_OMA_H +#define AVCODEC_OMA_H + +#include <stdint.h> + #include "internal.h" -#include "oma.h" -#include "libavcodec/avcodec.h" #include "libavutil/channel_layout.h" -const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0 }; +#define EA3_HEADER_SIZE 96 +#define ID3v2_EA3_MAGIC "ea3" +#define OMA_ENC_HEADER_SIZE 16 -const AVCodecTag ff_oma_codec_tags[] = { - { AV_CODEC_ID_ATRAC3, OMA_CODECID_ATRAC3 }, - { AV_CODEC_ID_ATRAC3P, OMA_CODECID_ATRAC3P }, - { AV_CODEC_ID_MP3, OMA_CODECID_MP3 }, - { AV_CODEC_ID_PCM_S16BE, OMA_CODECID_LPCM }, - { AV_CODEC_ID_ATRAC3PAL, OMA_CODECID_ATRAC3PAL }, - { AV_CODEC_ID_ATRAC3AL, OMA_CODECID_ATRAC3AL }, - { 0 }, -}; +static const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0 }; /** map ATRAC-X channel id to internal channel layout */ -const uint64_t ff_oma_chid_to_native_layout[7] = { +static const uint64_t ff_oma_chid_to_native_layout[7] = { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_SURROUND, @@ -47,4 +44,6 @@ const uint64_t ff_oma_chid_to_native_layout[7] = { }; /** map ATRAC-X channel id to total number of channels */ -const int ff_oma_chid_to_num_channels[7] = {1, 2, 3, 4, 6, 7, 8}; +static const int ff_oma_chid_to_num_channels[7] = {1, 2, 3, 4, 6, 7, 8}; + +#endif /* AVCODEC_OMA_H */ diff --git a/libavcodec/version.h b/libavcodec/version.h index d55de89797..d48857578d 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #define LIBAVCODEC_VERSION_MAJOR 58 #define LIBAVCODEC_VERSION_MINOR 8 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/libavformat/Makefile b/libavformat/Makefile index cb70eac920..ef0365e6e2 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -358,8 +358,8 @@ OBJS-$(CONFIG_OGG_MUXER) += oggenc.o \ vorbiscomment.o OBJS-$(CONFIG_OGV_MUXER) += oggenc.o \ vorbiscomment.o -OBJS-$(CONFIG_OMA_DEMUXER) += omadec.o pcm.o oma.o -OBJS-$(CONFIG_OMA_MUXER) += omaenc.o rawenc.o oma.o id3v2enc.o +OBJS-$(CONFIG_OMA_DEMUXER) += omadec.o pcm.o +OBJS-$(CONFIG_OMA_MUXER) += omaenc.o rawenc.o id3v2enc.o OBJS-$(CONFIG_OPUS_MUXER) += oggenc.o \ vorbiscomment.o OBJS-$(CONFIG_PAF_DEMUXER) += paf.o diff --git a/libavformat/oma.h b/libavformat/oma.h index 36fd0125e4..ccd57d779e 100644 --- a/libavformat/oma.h +++ b/libavformat/oma.h @@ -21,14 +21,8 @@ #ifndef AVFORMAT_OMA_H #define AVFORMAT_OMA_H -#include <stdint.h> - #include "internal.h" -#define EA3_HEADER_SIZE 96 -#define ID3v2_EA3_MAGIC "ea3" -#define OMA_ENC_HEADER_SIZE 16 - enum { OMA_CODECID_ATRAC3 = 0, OMA_CODECID_ATRAC3P = 1, @@ -39,11 +33,14 @@ enum { OMA_CODECID_ATRAC3AL = 34, }; -extern const uint16_t ff_oma_srate_tab[8]; - -extern const AVCodecTag ff_oma_codec_tags[]; - -extern const uint64_t ff_oma_chid_to_native_layout[7]; -extern const int ff_oma_chid_to_num_channels[7]; +static const AVCodecTag ff_oma_codec_tags[] = { + { AV_CODEC_ID_ATRAC3, OMA_CODECID_ATRAC3 }, + { AV_CODEC_ID_ATRAC3P, OMA_CODECID_ATRAC3P }, + { AV_CODEC_ID_MP3, OMA_CODECID_MP3 }, + { AV_CODEC_ID_PCM_S16BE, OMA_CODECID_LPCM }, + { AV_CODEC_ID_ATRAC3PAL, OMA_CODECID_ATRAC3PAL }, + { AV_CODEC_ID_ATRAC3AL, OMA_CODECID_ATRAC3AL }, + { 0 }, +}; #endif /* AVFORMAT_OMA_H */ diff --git a/libavformat/omadec.c b/libavformat/omadec.c index 423d52b3aa..ccefd6c1bc 100644 --- a/libavformat/omadec.c +++ b/libavformat/omadec.c @@ -48,6 +48,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/des.h" #include "libavutil/mathematics.h" +#include "libavcodec/oma.h" #include "oma.h" #include "pcm.h" #include "id3v2.h" diff --git a/libavformat/omaenc.c b/libavformat/omaenc.c index 7952808bf8..6e72c3ee85 100644 --- a/libavformat/omaenc.c +++ b/libavformat/omaenc.c @@ -24,6 +24,7 @@ #include "avio_internal.h" #include "id3v2.h" #include "internal.h" +#include "libavcodec/oma.h" #include "oma.h" #include "rawenc.h" diff --git a/libavformat/version.h b/libavformat/version.h index 5ced041f0a..6453d4559f 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -33,7 +33,7 @@ // Also please add any ticket numbers that you believe might be affected here #define LIBAVFORMAT_VERSION_MAJOR 58 #define LIBAVFORMAT_VERSION_MINOR 3 -#define LIBAVFORMAT_VERSION_MICRO 100 +#define LIBAVFORMAT_VERSION_MICRO 101 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \
From: Misty De Meo <mistydemeo@gmail.com> Most of the constants in libavcodec/oma aren't specific to libavformat; moving them into libavcodec makes them available to libavcodec as well as keeping them compatible with libavformat. ff_oma_codec_tags uses a libavformat-specific type, so it has been left in libavformat. --- libavformat/oma.c => libavcodec/oma.h | 27 +++++++++++++-------------- libavcodec/version.h | 2 +- libavformat/Makefile | 4 ++-- libavformat/oma.h | 21 +++++++++------------ libavformat/omadec.c | 1 + libavformat/omaenc.c | 1 + libavformat/version.h | 2 +- 7 files changed, 28 insertions(+), 30 deletions(-) rename libavformat/oma.c => libavcodec/oma.h (65%)