[FFmpeg-devel] [PATCH 2/6] oma: move some constants into libavcodec
Michael Niedermayer
michael at niedermayer.cc
Sat Jan 6 02:22:21 EET 2018
On Fri, Jan 05, 2018 at 10:34:44PM +1100, misty at brew.sh wrote:
> From: Misty De Meo <mistydemeo at 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 | 13 +++++++------
> libavformat/omaenc.c | 7 ++++---
> libavformat/version.h | 2 +-
> 7 files changed, 37 insertions(+), 39 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..f091ef24ca 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 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 oma_chid_to_native_layout[7] = {
Moving tables into header files which are included in multiple files
within the lib
libavformat/omadec.c:#include "libavcodec/oma.h"
libavformat/omadec.c:#include "oma.h"
libavformat/omaenc.c:#include "libavcodec/oma.h"
libavformat/omaenc.c:#include "oma.h"
would lead to duplicate versions of these tables within the lib
not a major issue as these are tiny but existing code does not do
such duplication. I think we should not add such intra lib
duplication
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180106/d23799f9/attachment.sig>
More information about the ffmpeg-devel
mailing list