Commit 3a7ef8dc authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '57231e4d'

* commit '57231e4d':
  tak: demuxer, parser, and decoder

Not merged as requested by Author and Maintainer of tak in FFmpeg.
I just merged a few typo fixes and minor cosmetic improvments.

Conflicts:
	Changelog
	libavcodec/Makefile
	libavcodec/allcodecs.c
	libavcodec/avcodec.h
	libavcodec/tak.c
	libavcodec/tak.h
	libavcodec/tak_parser.c
	libavcodec/takdec.c
	libavcodec/version.h
	libavformat/takdec.c
	libavformat/version.h
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 64e174e8 57231e4d
......@@ -433,6 +433,7 @@ enum AVCodecID {
AV_CODEC_ID_ILBC,
AV_CODEC_ID_OPUS_DEPRECATED,
AV_CODEC_ID_COMFORT_NOISE,
AV_CODEC_ID_TAK_DEPRECATED,
AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
AV_CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
......
......@@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "tak.h"
#include "libavutil/bswap.h"
#include "libavutil/crc.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/bswap.h"
#include "tak.h"
static const int64_t tak_channel_layouts[] = {
0,
......
......@@ -27,33 +27,35 @@
#ifndef AVCODEC_TAK_H
#define AVCODEC_TAK_H
#include <stdint.h>
#define BITSTREAM_READER_LE
#include "get_bits.h"
#include "avcodec.h"
#define TAK_FORMAT_DATA_TYPE_BITS 3
#define TAK_FORMAT_SAMPLE_RATE_BITS 18
#define TAK_FORMAT_BPS_BITS 5
#define TAK_FORMAT_CHANNEL_BITS 4
#define TAK_FORMAT_VALID_BITS 5
#define TAK_FORMAT_CH_LAYOUT_BITS 6
#define TAK_SIZE_FRAME_DURATION_BITS 4
#define TAK_SIZE_SAMPLES_NUM_BITS 35
#define TAK_LAST_FRAME_POS_BITS 40
#define TAK_LAST_FRAME_SIZE_BITS 24
#define TAK_ENCODER_CODEC_BITS 6
#define TAK_ENCODER_PROFILE_BITS 4
#define TAK_ENCODER_VERSION_BITS 24
#define TAK_SAMPLE_RATE_MIN 6000
#define TAK_CHANNELS_MIN 1
#define TAK_BPS_MIN 8
#define TAK_FRAME_HEADER_FLAGS_BITS 3
#define TAK_FRAME_HEADER_SYNC_ID 0xA0FF
#define TAK_FRAME_HEADER_SYNC_ID_BITS 16
#define TAK_FRAME_HEADER_SAMPLE_COUNT_BITS 14
#define TAK_FRAME_HEADER_NO_BITS 21
#define TAK_FRAME_DURATION_QUANT_SHIFT 5
#define TAK_CRC24_BITS 24
#define TAK_FORMAT_DATA_TYPE_BITS 3
#define TAK_FORMAT_SAMPLE_RATE_BITS 18
#define TAK_FORMAT_BPS_BITS 5
#define TAK_FORMAT_CHANNEL_BITS 4
#define TAK_FORMAT_VALID_BITS 5
#define TAK_FORMAT_CH_LAYOUT_BITS 6
#define TAK_SIZE_FRAME_DURATION_BITS 4
#define TAK_SIZE_SAMPLES_NUM_BITS 35
#define TAK_LAST_FRAME_POS_BITS 40
#define TAK_LAST_FRAME_SIZE_BITS 24
#define TAK_ENCODER_CODEC_BITS 6
#define TAK_ENCODER_PROFILE_BITS 4
#define TAK_ENCODER_VERSION_BITS 24
#define TAK_SAMPLE_RATE_MIN 6000
#define TAK_CHANNELS_MIN 1
#define TAK_BPS_MIN 8
#define TAK_FRAME_HEADER_FLAGS_BITS 3
#define TAK_FRAME_HEADER_SYNC_ID 0xA0FF
#define TAK_FRAME_HEADER_SYNC_ID_BITS 16
#define TAK_FRAME_HEADER_SAMPLE_COUNT_BITS 14
#define TAK_FRAME_HEADER_NO_BITS 21
#define TAK_FRAME_DURATION_QUANT_SHIFT 5
#define TAK_CRC24_BITS 24
#define TAK_MAX_CHANNELS ( 1 << TAK_FORMAT_CHANNEL_BITS )
......@@ -132,17 +134,17 @@ void ff_tak_init_crc(void);
int ff_tak_check_crc(const uint8_t *buf, unsigned int buf_size);
/**
* Parse the Streaminfo metadata block
* @param[in] gb pointer to GetBitContext
* @param[out] s where parsed information is stored
* Parse the Streaminfo metadata block.
* @param[in] gb pointer to GetBitContext
* @param[out] s storage for parsed information
*/
void avpriv_tak_parse_streaminfo(GetBitContext *gb, TAKStreamInfo *s);
/**
* Validate and decode a frame header.
* @param avctx AVCodecContext to use as av_log() context
* @param[in] gb GetBitContext from which to read frame header
* @param[out] s frame information
* @param avctx AVCodecContext to use as av_log() context
* @param[in] gb GetBitContext from which to read frame header
* @param[out] s frame information
* @param log_level_offset log level offset. can be used to silence error messages.
* @return non-zero on error, 0 if ok
*/
......
......@@ -30,7 +30,7 @@
typedef struct TAKParseContext {
ParseContext pc;
TAKStreamInfo ti;
int index;
int index;
} TAKParseContext;
static av_cold int tak_init(AVCodecParserContext *s)
......
......@@ -1917,6 +1917,7 @@ static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)
//last major bump but will fill up again over time, please don't remove it
// case AV_CODEC_ID_UTVIDEO_DEPRECATED: return AV_CODEC_ID_UTVIDEO;
case AV_CODEC_ID_OPUS_DEPRECATED: return AV_CODEC_ID_OPUS;
case AV_CODEC_ID_TAK_DEPRECATED : return AV_CODEC_ID_TAK;
default : return id;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment