• 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

74     AVCodecContext *avctx;
83 for (ch = 0; ch < s->avctx->channels; ch++) {
85 for (i = 0; i < s->avctx->frame_size; i++) {
87 sptr += s->avctx->channels;
122 put_bits(&s->pbctx, 3, s->avctx->channels-1); // No. of channels -1
127 put_bits32(&s->pbctx, s->avctx->frame_size); // No. of samples in the frame
147 s->avctx->frame_size,
197 int i, mode, n = s->avctx->frame_size;
247 for (i = 1; i < s->avctx->frame_size; i++)
265 for (i = lpc.lpc_order + 1; i < s->avctx->frame_size; i++) {
308 for (i = 0; i < s->avctx->frame_size;) {
328 if (history < 128 && i < s->avctx->frame_size) {
333 while (*samples == 0 && i < s->avctx->frame_size) {
353 if (s->avctx->channels == 2)
358 for (i = 0; i < s->avctx->channels; i++) {
375 for (i = 0; i < s->avctx->channels; i++) {
381 for (j = s->avctx->frame_size - 1; j > 0; j--)
389 static av_cold int alac_encode_init(AVCodecContext *avctx)
391 AlacEncodeContext *s = avctx->priv_data;
395 avctx->frame_size = DEFAULT_FRAME_SIZE;
396 avctx->bits_per_coded_sample = DEFAULT_SAMPLE_SIZE;
398 if (avctx->sample_fmt != AV_SAMPLE_FMT_S16) {
399 av_log(avctx, AV_LOG_ERROR, "only pcm_s16 input samples are supported\n");
406 if (avctx->channels > 2) {
407 av_log(avctx, AV_LOG_ERROR, "only mono or stereo input is currently supported\n");
412 if (avctx->compression_level == FF_COMPRESSION_DEFAULT)
415 s->compression_level = av_clip(avctx->compression_level, 0, 2);
423 s->max_coded_frame_size = 8 + (avctx->frame_size*avctx->channels*avctx->bits_per_coded_sample>>3);
425 s->write_sample_size = avctx->bits_per_coded_sample + avctx->channels - 1; // FIXME: consider wasted_bytes
429 AV_WB32(alac_extradata+12, avctx->frame_size);
430 AV_WB8 (alac_extradata+17, avctx->bits_per_coded_sample);
431 AV_WB8 (alac_extradata+21, avctx->channels);
434 avctx->sample_rate * avctx->channels * avctx->bits_per_coded_sample); // average bitrate
435 AV_WB32(alac_extradata+32, avctx->sample_rate);
445 if (avctx->min_prediction_order >= 0) {
446 if (avctx->min_prediction_order < MIN_LPC_ORDER ||
447 avctx->min_prediction_order > ALAC_MAX_LPC_ORDER) {
448 av_log(avctx, AV_LOG_ERROR, "invalid min prediction order: %d\n",
449 avctx->min_prediction_order);
453 s->min_prediction_order = avctx->min_prediction_order;
457 if (avctx->max_prediction_order >= 0) {
458 if (avctx->max_prediction_order < MIN_LPC_ORDER ||
459 avctx->max_prediction_order > ALAC_MAX_LPC_ORDER) {
460 av_log(avctx, AV_LOG_ERROR, "invalid max prediction order: %d\n",
461 avctx->max_prediction_order);
465 s->max_prediction_order = avctx->max_prediction_order;
469 av_log(avctx, AV_LOG_ERROR,
475 avctx->extradata = alac_extradata;
476 avctx->extradata_size = ALAC_EXTRADATA_SIZE;
478 avctx->coded_frame = avcodec_alloc_frame();
479 avctx->coded_frame->key_frame = 1;
481 s->avctx = avctx;
482 ret = ff_lpc_init(&s->lpc_ctx, avctx->frame_size, s->max_prediction_order,
488 static int alac_encode_frame(AVCodecContext *avctx, uint8_t *frame,
491 AlacEncodeContext *s = avctx->priv_data;
495 if (avctx->frame_size > DEFAULT_FRAME_SIZE) {
496 av_log(avctx, AV_LOG_ERROR, "input frame size exceeded\n");
501 av_log(avctx, AV_LOG_ERROR, "buffer size is too small\n");
512 for (i = 0; i < avctx->frame_size * avctx->channels; i++) {
529 av_log(avctx, AV_LOG_ERROR, "error encoding frame\n");
539 static av_cold int alac_encode_close(AVCodecContext *avctx)
541 AlacEncodeContext *s = avctx->priv_data;
543 av_freep(&avctx->extradata);
544 avctx->extradata_size = 0;
545 av_freep(&avctx->coded_frame);