22 #include <celt/celt.h>
23 #include <celt/celt_header.h>
37 case CELT_BAD_ARG:
return AVERROR(EINVAL);
38 #ifdef CELT_BUFFER_TOO_SMALL
39 case CELT_BUFFER_TOO_SMALL:
return AVERROR(ENOBUFS);
41 case CELT_INTERNAL_ERROR:
return AVERROR(EFAULT);
43 case CELT_UNIMPLEMENTED:
return AVERROR(ENOSYS);
44 #ifdef ENOTRECOVERABLE
45 case CELT_INVALID_STATE:
return AVERROR(ENOTRECOVERABLE);
47 case CELT_ALLOC_FAIL:
return AVERROR(ENOMEM);
48 default:
return AVERROR(EINVAL);
54 CELTHeader
header = { .version_id = 0 };
55 celt_header_init(&header, mode, 960, 2);
56 return header.version_id;
72 celt_mode_destroy(celt->
mode);
79 "Invalid overlap (%d), ignored.\n", celt->
discard);
86 if (version != lib_version)
88 "CELT bitstream version 0x%x may be "
89 "improperly decoded by libcelt for version 0x%x.\n",
90 version, lib_version);
100 celt_decoder_destroy(celt->
dec);
101 celt_mode_destroy(celt->
mode);
116 pcm = (int16_t *)frame->
data[0];
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
#define AV_LOG_WARNING
Something somehow does not look correct.
static int libcelt_dec_decode(AVCodecContext *c, void *data, int *got_frame_ptr, AVPacket *pkt)
enum AVSampleFormat sample_fmt
audio sample format
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static const uint8_t header[24]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Name of the codec implementation.
AVCodec ff_libcelt_decoder
static int ff_celt_bitstream_version_hack(CELTMode *mode)
int frame_size
Number of samples per channel in an audio frame.
Libavcodec external API header.
int sample_rate
samples per second
main external API structure.
static av_cold int libcelt_dec_close(AVCodecContext *c)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
int channels
number of audio channels
static av_cold int libcelt_dec_init(AVCodecContext *c)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
static int ff_celt_error_to_averror(int err)
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.