28 #define AES3_HEADER_LEN 4
40 "Encoding %d channel(s) is not allowed. Only 2, 4, 6 and 8 channels are supported.\n",
100 const uint32_t *samples = (uint32_t *)frame->
data[0];
105 for (channels = 0; channels < avctx->
channels; channels += 2) {
106 o[0] =
ff_reverse[(samples[0] & 0x0000FF00) >> 8];
107 o[1] =
ff_reverse[(samples[0] & 0x00FF0000) >> 16];
108 o[2] =
ff_reverse[(samples[0] & 0xFF000000) >> 24];
109 o[3] =
ff_reverse[(samples[1] & 0x00000F00) >> 4] | vucf;
110 o[4] =
ff_reverse[(samples[1] & 0x000FF000) >> 12];
111 o[5] =
ff_reverse[(samples[1] & 0x0FF00000) >> 20];
112 o[6] =
ff_reverse[(samples[1] & 0xF0000000) >> 28];
122 const uint32_t *samples = (uint32_t *)frame->
data[0];
127 for (channels = 0; channels < avctx->
channels; channels += 2) {
128 o[0] =
ff_reverse[ (samples[0] & 0x000FF000) >> 12];
129 o[1] =
ff_reverse[ (samples[0] & 0x0FF00000) >> 20];
130 o[2] =
ff_reverse[((samples[0] & 0xF0000000) >> 28) | vucf];
131 o[3] =
ff_reverse[ (samples[1] & 0x000FF000) >> 12];
132 o[4] =
ff_reverse[ (samples[1] & 0x0FF00000) >> 20];
133 o[5] =
ff_reverse[ (samples[1] & 0xF0000000) >> 28];
143 const uint16_t *samples = (uint16_t *)frame->
data[0];
148 for (channels = 0; channels < avctx->
channels; channels += 2) {
150 o[1] =
ff_reverse[(samples[0] & 0xFF00) >> 8];
151 o[2] =
ff_reverse[(samples[1] & 0x0F) << 4] | vucf;
152 o[3] =
ff_reverse[(samples[1] & 0x0FF0) >> 4];
153 o[4] =
ff_reverse[(samples[1] & 0xF000) >> 12];
182 .supported_samplerates = (
const int[]) { 48000, 0 },
This structure describes decoded (raw) audio or video data.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
#define AV_LOG_WARNING
Something somehow does not look correct.
int64_t bit_rate
the average bitrate
static av_cold int init(AVCodecContext *avctx)
const uint8_t ff_reverse[256]
#define AV_CODEC_CAP_EXPERIMENTAL
Codec is experimental and is thus avoided in favor of non experimental encoders.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
Check AVPacket size and/or allocate data.
enum AVSampleFormat sample_fmt
audio sample format
static int s302m_encode2_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#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.
#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE
Audio encoder supports receiving a different number of samples in each call.
int frame_size
Number of samples per channel in an audio frame.
Libavcodec external API header.
AVSampleFormat
Audio sample formats.
main external API structure.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
int channels
number of audio channels
static enum AVSampleFormat sample_fmts[]
static av_cold int s302m_encode_init(AVCodecContext *avctx)
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame