Lines Matching defs:avctx
32 static av_cold int pcm_bluray_encode_init(AVCodecContext *avctx)
34 BlurayPCMEncContext *s = avctx->priv_data;
38 switch (avctx->sample_fmt) {
40 avctx->bits_per_coded_sample = 16;
46 avctx->bits_per_coded_sample = 24;
53 switch (avctx->sample_rate) {
67 switch (avctx->ch_layout.u.mask) {
103 avctx->frame_size = frame_size;
108 static int pcm_bluray_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
111 BlurayPCMEncContext *s = avctx->priv_data;
119 num_dest_channels = FFALIGN(avctx->ch_layout.nb_channels, 2);
121 (avctx->sample_fmt == AV_SAMPLE_FMT_S16 ? 16 : 24)) >> 3;
126 if ((ret = ff_get_encode_buffer(avctx, avpkt, pkt_size, 0)) < 0)
137 switch (avctx->ch_layout.u.mask) {
143 if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
162 if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
165 bytestream2_put_bufferu(&pb, (const uint8_t *)src16, avctx->ch_layout.nb_channels * 2);
166 src16 += avctx->ch_layout.nb_channels;
168 channel = avctx->ch_layout.nb_channels;
177 channel = avctx->ch_layout.nb_channels;
187 if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
211 if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
239 if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
270 avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);