mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
avcodec: add CBD2 DPCM decoder
This commit is contained in:
parent
0c7da96924
commit
01343683fa
@ -30,6 +30,7 @@ version <next>:
|
||||
- adrc audio filter
|
||||
- afdelaysrc audio filter
|
||||
- WADY DPCM decoder and demuxer
|
||||
- CBD2 DPCM decoder
|
||||
|
||||
|
||||
version 5.1:
|
||||
|
@ -278,6 +278,7 @@ OBJS-$(CONFIG_BRENDER_PIX_DECODER) += brenderpix.o
|
||||
OBJS-$(CONFIG_C93_DECODER) += c93.o
|
||||
OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o \
|
||||
cavsdata.o
|
||||
OBJS-$(CONFIG_CBD2_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_CCAPTION_DECODER) += ccaption_dec.o ass.o
|
||||
OBJS-$(CONFIG_CDGRAPHICS_DECODER) += cdgraphics.o
|
||||
OBJS-$(CONFIG_CDTOONS_DECODER) += cdtoons.o
|
||||
|
@ -620,6 +620,7 @@ extern const FFCodec ff_pcm_vidc_encoder;
|
||||
extern const FFCodec ff_pcm_vidc_decoder;
|
||||
|
||||
/* DPCM codecs */
|
||||
extern const FFCodec ff_cbd2_dpcm_decoder;
|
||||
extern const FFCodec ff_derf_dpcm_decoder;
|
||||
extern const FFCodec ff_gremlin_dpcm_decoder;
|
||||
extern const FFCodec ff_interplay_dpcm_decoder;
|
||||
|
@ -2626,6 +2626,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
|
||||
.long_name = NULL_IF_CONFIG_SMALL("DPCM Marble WADY"),
|
||||
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
|
||||
},
|
||||
{
|
||||
.id = AV_CODEC_ID_CBD2_DPCM,
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.name = "cbd2_dpcm",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("DPCM Cuberoot-Delta-Exact"),
|
||||
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
|
||||
},
|
||||
|
||||
/* audio codecs */
|
||||
{
|
||||
|
@ -431,6 +431,7 @@ enum AVCodecID {
|
||||
AV_CODEC_ID_GREMLIN_DPCM,
|
||||
AV_CODEC_ID_DERF_DPCM,
|
||||
AV_CODEC_ID_WADY_DPCM,
|
||||
AV_CODEC_ID_CBD2_DPCM,
|
||||
|
||||
/* audio codecs */
|
||||
AV_CODEC_ID_MP2 = 0x15000,
|
||||
|
@ -194,6 +194,13 @@ static av_cold int dpcm_decode_init(AVCodecContext *avctx)
|
||||
}
|
||||
break;
|
||||
|
||||
case AV_CODEC_ID_CBD2_DPCM:
|
||||
for (i = -128; i < 128; i++) {
|
||||
int16_t cube = (i * i * i) / 64;
|
||||
s->array[i+128] = cube;
|
||||
}
|
||||
break;
|
||||
|
||||
case AV_CODEC_ID_GREMLIN_DPCM: {
|
||||
int delta = 0;
|
||||
int code = 64;
|
||||
@ -265,6 +272,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
||||
case AV_CODEC_ID_WADY_DPCM:
|
||||
case AV_CODEC_ID_DERF_DPCM:
|
||||
case AV_CODEC_ID_GREMLIN_DPCM:
|
||||
case AV_CODEC_ID_CBD2_DPCM:
|
||||
case AV_CODEC_ID_SDX2_DPCM:
|
||||
out = buf_size;
|
||||
break;
|
||||
@ -386,6 +394,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
||||
}
|
||||
break;
|
||||
|
||||
case AV_CODEC_ID_CBD2_DPCM:
|
||||
case AV_CODEC_ID_SDX2_DPCM:
|
||||
while (output_samples < samples_end) {
|
||||
int8_t n = bytestream2_get_byteu(&gb);
|
||||
@ -468,6 +477,7 @@ const FFCodec ff_ ## name_ ## _decoder = { \
|
||||
FF_CODEC_DECODE_CB(dpcm_decode_frame), \
|
||||
}
|
||||
|
||||
DPCM_DECODER(AV_CODEC_ID_CBD2_DPCM, cbd2_dpcm, "DPCM Cuberoot-Delta-Exact");
|
||||
DPCM_DECODER(AV_CODEC_ID_DERF_DPCM, derf_dpcm, "DPCM Xilam DERF");
|
||||
DPCM_DECODER(AV_CODEC_ID_GREMLIN_DPCM, gremlin_dpcm, "DPCM Gremlin");
|
||||
DPCM_DECODER(AV_CODEC_ID_INTERPLAY_DPCM, interplay_dpcm, "DPCM Interplay");
|
||||
|
@ -514,6 +514,7 @@ int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
|
||||
case AV_CODEC_ID_PCM_SGA:
|
||||
case AV_CODEC_ID_PCM_U8:
|
||||
case AV_CODEC_ID_SDX2_DPCM:
|
||||
case AV_CODEC_ID_CBD2_DPCM:
|
||||
case AV_CODEC_ID_DERF_DPCM:
|
||||
case AV_CODEC_ID_WADY_DPCM:
|
||||
return 8;
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
#include "version_major.h"
|
||||
|
||||
#define LIBAVCODEC_VERSION_MINOR 57
|
||||
#define LIBAVCODEC_VERSION_MINOR 58
|
||||
#define LIBAVCODEC_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||
|
@ -46,6 +46,7 @@ const AVCodecTag ff_codec_aiff_tags[] = {
|
||||
{ AV_CODEC_ID_QDMC, MKTAG('Q','D','M','C') },
|
||||
{ AV_CODEC_ID_QDM2, MKTAG('Q','D','M','2') },
|
||||
{ AV_CODEC_ID_QCELP, MKTAG('Q','c','l','p') },
|
||||
{ AV_CODEC_ID_CBD2_DPCM, MKTAG('C','B','D','2') },
|
||||
{ AV_CODEC_ID_SDX2_DPCM, MKTAG('S','D','X','2') },
|
||||
{ AV_CODEC_ID_ADPCM_IMA_WS, MKTAG('A','D','P','4') },
|
||||
{ AV_CODEC_ID_NONE, 0 },
|
||||
|
@ -164,6 +164,7 @@ static int get_aiff_header(AVFormatContext *s, int64_t size,
|
||||
case AV_CODEC_ID_ADPCM_IMA_WS:
|
||||
case AV_CODEC_ID_ADPCM_G722:
|
||||
case AV_CODEC_ID_MACE6:
|
||||
case AV_CODEC_ID_CBD2_DPCM:
|
||||
case AV_CODEC_ID_SDX2_DPCM:
|
||||
par->block_align = 1 * channels;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user