69 av_log(avctx,
AV_LOG_ERROR,
"Too big bitrate: reduce sample rate, bitdepth or channels.\n");
74 s->samples_per_block = 1;
85 s->groups_per_block = 1;
90 s->samples_per_block = 1;
91 s->groups_per_block = 2;
97 s->samples_per_block = 4;
120 int blocks = (pkt_size - 3) /
s->block_size;
121 const int16_t *src16;
129 memcpy(avpkt->
data,
s->header, 3);
131 src16 = (
const int16_t *)
frame->data[0];
139 bytestream2_put_be16(&pb, *src16++);
145 for (
int i = 2;
i;
i--) {
146 bytestream2_put_be16(&pb, src32[0] >> 16);
147 bytestream2_put_be16(&pb, src32[1] >> 16);
148 bytestream2_put_byte(&pb, (uint8_t)((*src32++) >> 8));
149 bytestream2_put_byte(&pb, (uint8_t)((*src32++) >> 8));
154 for (
int i =
s->groups_per_block;
i;
i--) {
155 bytestream2_put_be16(&pb, src32[0] >> 16);
156 bytestream2_put_be16(&pb, src32[1] >> 16);
157 bytestream2_put_be16(&pb, src32[2] >> 16);
158 bytestream2_put_be16(&pb, src32[3] >> 16);
159 bytestream2_put_byte(&pb, (uint8_t)((*src32++) >> 8));
160 bytestream2_put_byte(&pb, (uint8_t)((*src32++) >> 8));
161 bytestream2_put_byte(&pb, (uint8_t)((*src32++) >> 8));
162 bytestream2_put_byte(&pb, (uint8_t)((*src32++) >> 8));
176 CODEC_LONG_NAME(
"PCM signed 16|20|24-bit big-endian for DVD-Video media"),
const FFCodec ff_pcm_dvd_encoder
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_unreachable(msg)
Asserts that are used as compiler optimization hints depending upon ASSERT_LEVEL and NBDEBUG.
Libavcodec external API header.
static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size)
#define i(width, name, range_min, range_max)
Public libavutil channel layout APIs header.
#define CODEC_CH_LAYOUTS(...)
#define CODEC_SAMPLERATES(...)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
#define CODEC_SAMPLEFMTS(...)
int(* init)(AVBSFContext *ctx)
int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags)
Get a buffer for a packet.
static const uint8_t frame_size[4]
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
#define AV_CHANNEL_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_5POINT1
#define AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_7POINT1
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_SAMPLE_FMT_S32
signed 32 bits
@ AV_SAMPLE_FMT_S16
signed 16 bits
static av_cold int pcm_dvd_encode_init(AVCodecContext *avctx)
static int pcm_dvd_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
int nb_channels
Number of channels in this layout.
main external API structure.
AVChannelLayout ch_layout
Audio channel layout.
enum AVSampleFormat sample_fmt
audio sample format
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
int64_t bit_rate
the average bitrate
int sample_rate
samples per second
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs.
int frame_size
Number of samples per channel in an audio frame.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
static const uint8_t quant[64]