• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/libav-0.8.8/libavcodec/

Lines Matching refs:avctx

35 static av_cold int pcm_encode_init(AVCodecContext *avctx)
37 avctx->frame_size = 0;
38 switch(avctx->codec->id) {
49 avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
50 avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
51 avctx->coded_frame= avcodec_alloc_frame();
52 avctx->coded_frame->key_frame= 1;
57 static av_cold int pcm_encode_close(AVCodecContext *avctx)
59 av_freep(&avctx->coded_frame);
81 static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
94 sample_size = av_get_bits_per_sample(avctx->codec->id)/8;
95 n = frame->nb_samples * avctx->channels;
99 av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
104 switch(avctx->codec->id) {
196 avpkt->size = frame->nb_samples * avctx->channels * sample_size;
206 static av_cold int pcm_decode_init(AVCodecContext * avctx)
208 PCMDecode *s = avctx->priv_data;
211 if (avctx->channels <= 0 || avctx->channels > MAX_CHANNELS) {
212 av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n");
216 switch(avctx->codec->id) {
229 avctx->sample_fmt = avctx->codec->sample_fmts[0];
231 if (avctx->sample_fmt == AV_SAMPLE_FMT_S32)
232 avctx->bits_per_raw_sample = av_get_bits_per_sample(avctx->codec->id);
235 avctx->coded_frame = &s->frame;
257 static int pcm_decode_frame(AVCodecContext *avctx, void *data,
262 PCMDecode *s = avctx->priv_data;
267 sample_size = av_get_bits_per_sample(avctx->codec_id)/8;
271 if (CODEC_ID_PCM_DVD == avctx->codec_id) {
272 if (avctx->bits_per_coded_sample != 20 &&
273 avctx->bits_per_coded_sample != 24) {
274 av_log(avctx, AV_LOG_ERROR, "PCM DVD unsupported sample depth\n");
279 sample_size = avctx->bits_per_coded_sample * 2 / 8;
280 } else if (avctx->codec_id == CODEC_ID_PCM_LXF) {
287 av_log(avctx, AV_LOG_ERROR, "Invalid sample_size\n");
291 n = avctx->channels * sample_size;
295 av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
304 s->frame.nb_samples = n * samples_per_block / avctx->channels;
305 if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
306 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
311 switch(avctx->codec->id) {
342 n /= avctx->channels;
343 for(c=0;c<avctx->channels;c++)
346 for(c=0;c<avctx->channels;c++) {
416 n /= avctx->channels;
417 switch (avctx->bits_per_coded_sample) {
420 c = avctx->channels;
431 c = avctx->channels;
448 n /= avctx->channels;
451 for (c = 0, src8 = src + i*5; c < avctx->channels; c++, src8 += n*5) {
457 for (c = 0, src8 = src + i*5; c < avctx->channels; c++, src8 += n*5) {