• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/minidlna/ffmpeg-2.3.4/libavcodec/

Lines Matching refs:avctx

84 static int xvid_encode_close(AVCodecContext *avctx);
260 * @param avctx AVCodecContext pointer to context
266 static int xvid_strip_vol_header(AVCodecContext *avctx,
284 if( avctx->extradata == NULL ) {
285 avctx->extradata = av_malloc(vo_len);
286 memcpy(avctx->extradata, pkt->data, vo_len);
287 avctx->extradata_size = vo_len;
304 * @param avctx Context that contains the framerate to correct.
306 static void xvid_correct_framerate(AVCodecContext *avctx)
313 frate = avctx->time_base.den;
314 fbase = avctx->time_base.num;
323 avctx->time_base.den = frate;
324 avctx->time_base.num = fbase;
345 avctx->time_base.den = est_frate;
346 avctx->time_base.num = est_fbase;
347 av_log(avctx, AV_LOG_DEBUG,
351 avctx->time_base.den = frate;
352 avctx->time_base.num = fbase;
356 static av_cold int xvid_encode_init(AVCodecContext *avctx) {
358 int xvid_flags = avctx->flags;
359 struct xvid_context *x = avctx->priv_data;
379 if( avctx->trellis)
388 switch( avctx->me_method ) {
411 switch( avctx->mb_decision ) {
430 if (avctx->flags & CODEC_FLAG_GMC)
469 xvid_enc_create.width = x->xsize = avctx->width;
470 xvid_enc_create.height = x->ysize = avctx->height;
479 xvid_enc_create.num_threads = avctx->thread_count;
495 av_log(avctx, AV_LOG_ERROR,
506 rc2pass2.bitrate = avctx->bit_rate;
508 fd = av_tempfile("xvidff.", &x->twopassfile, 0, avctx);
510 av_log(avctx, AV_LOG_ERROR,
516 if( avctx->stats_in == NULL ) {
517 av_log(avctx, AV_LOG_ERROR,
522 if( strlen(avctx->stats_in) >
523 write(fd, avctx->stats_in, strlen(avctx->stats_in)) ) {
524 av_log(avctx, AV_LOG_ERROR,
536 single.bitrate = avctx->bit_rate;
543 if (avctx->lumi_masking != 0.0)
551 /* The old behavior is that when avctx->lumi_masking is specified,
553 plugins[xvid_enc_create.num_plugins].param = avctx->lumi_masking ? NULL
567 av_log(avctx, AV_LOG_INFO,
583 xvid_correct_framerate(avctx);
584 xvid_enc_create.fincr = avctx->time_base.num;
585 xvid_enc_create.fbase = avctx->time_base.den;
586 if( avctx->gop_size > 0 )
587 xvid_enc_create.max_key_interval = avctx->gop_size;
595 xvid_enc_create.min_quant[0] = avctx->qmin;
596 xvid_enc_create.min_quant[1] = avctx->qmin;
597 xvid_enc_create.min_quant[2] = avctx->qmin;
598 xvid_enc_create.max_quant[0] = avctx->qmax;
599 xvid_enc_create.max_quant[1] = avctx->qmax;
600 xvid_enc_create.max_quant[2] = avctx->qmax;
604 if( avctx->mpeg_quant )
606 if( (avctx->intra_matrix || avctx->inter_matrix) ) {
609 if( avctx->intra_matrix ) {
610 intra = avctx->intra_matrix;
614 if( avctx->inter_matrix ) {
615 inter = avctx->inter_matrix;
635 avctx->extradata = NULL;
636 avctx->extradata_size = 0;
640 avctx->codec_id = AV_CODEC_ID_MPEG4;
644 if(!avctx->codec_tag)
645 avctx->codec_tag = AV_RL32("xvid");
649 xvid_enc_create.max_bframes = avctx->max_b_frames;
650 xvid_enc_create.bquant_offset = 100 * avctx->b_quant_offset;
651 xvid_enc_create.bquant_ratio = 100 * avctx->b_quant_factor;
652 if( avctx->max_b_frames > 0 && !x->quicktime_format ) xvid_enc_create.global |= XVID_GLOBAL_PACKED;
659 av_log(avctx, AV_LOG_ERROR, "Xvid: Could not create encoder reference\n");
664 avctx->coded_frame = av_frame_alloc();
665 if (!avctx->coded_frame)
670 xvid_encode_close(avctx);
674 static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
679 struct xvid_context *x = avctx->priv_data;
680 AVFrame *p = avctx->coded_frame;
681 int mb_width = (avctx->width + 15) / 16;
682 int mb_height = (avctx->height + 15) / 16;
687 if ((ret = ff_alloc_packet2(avctx, pkt, mb_width*mb_height*MAX_MB_BYTES + FF_MIN_BUFFER_SIZE)) < 0)
699 if( avctx->pix_fmt != AV_PIX_FMT_YUV420P ) {
700 av_log(avctx, AV_LOG_ERROR, "Xvid: Color spaces other than 420p not supported\n");
722 if (avctx->sample_aspect_ratio.num < 0 || avctx->sample_aspect_ratio.num > 255 ||
723 avctx->sample_aspect_ratio.den < 0 || avctx->sample_aspect_ratio.den > 255) {
724 av_log(avctx, AV_LOG_WARNING,
726 avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den);
727 av_reduce(&avctx->sample_aspect_ratio.num, &avctx->sample_aspect_ratio.den,
728 avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 255);
731 xvid_enc_frame.par_width = avctx->sample_aspect_ratio.num;
732 xvid_enc_frame.par_height = avctx->sample_aspect_ratio.den;
747 avctx->stats_out = NULL;
754 avctx->stats_out = x->old_twopassbuffer;
774 return xvid_strip_vol_header(avctx, pkt,
787 av_log(avctx, AV_LOG_ERROR, "Xvid: Encoding Error Occurred: %i\n", xerr);
792 static av_cold int xvid_encode_close(AVCodecContext *avctx) {
793 struct xvid_context *x = avctx->priv_data;
799 av_freep(&avctx->extradata);
803 avctx->stats_out = NULL;