• 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

37 static av_cold int utvideo_encode_init(AVCodecContext *avctx)
39 UtVideoContext *utv = (UtVideoContext *)avctx->priv_data;
43 switch (avctx->pix_fmt) {
46 avctx->bits_per_coded_sample = 12;
47 if (avctx->colorspace == AVCOL_SPC_BT709)
48 avctx->codec_tag = MKTAG('U', 'L', 'H', '0');
50 avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
54 avctx->bits_per_coded_sample = 16;
55 if (avctx->colorspace == AVCOL_SPC_BT709)
56 avctx->codec_tag = MKTAG('U', 'L', 'H', '2');
58 avctx->codec_tag = MKTAG('U', 'L', 'Y', '2');
62 avctx->bits_per_coded_sample = 24;
63 avctx->codec_tag = MKTAG('U', 'L', 'R', 'G');
67 avctx->bits_per_coded_sample = 32;
68 avctx->codec_tag = MKTAG('U', 'L', 'R', 'A');
75 if (avctx->prediction_method != 0 && avctx->prediction_method != 2) {
76 av_log(avctx, AV_LOG_ERROR, "Invalid prediction method.\n");
80 flags = ((avctx->prediction_method + 1) << 8) | (avctx->thread_count - 1);
82 avctx->priv_data = utv;
83 avctx->coded_frame = av_frame_alloc();
89 av_log(avctx, AV_LOG_ERROR, "Could not allocate extradata buffer.\n");
97 utv->buf_size = avpicture_get_size(avctx->pix_fmt,
98 avctx->width, avctx->height);
102 av_log(avctx, AV_LOG_ERROR, "Could not allocate output buffer.\n");
110 utv->codec = CCodec::CreateInstance(UNFCC(avctx->codec_tag), "libavcodec");
113 utv->codec->EncodeBegin(in_format, avctx->width, avctx->height,
117 avctx->extradata_size = utv->codec->EncodeGetExtraDataSize();
118 utv->codec->EncodeGetExtraData(info, avctx->extradata_size, in_format,
119 avctx->width, avctx->height,
121 avctx->extradata = (uint8_t *)info;
129 static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
132 UtVideoContext *utv = (UtVideoContext *)avctx->priv_data;
133 int w = avctx->width, h = avctx->height;
140 if ((ret = ff_alloc_packet2(avctx, pkt, utv->buf_size)) < 0)
146 switch (avctx->pix_fmt) {
170 rgb_size = avctx->pix_fmt == AV_PIX_FMT_BGR24 ? 3 : 4;
184 av_log(avctx, AV_LOG_ERROR, "EncodeFrame failed!\n");
195 avctx->coded_frame->key_frame = 1;
196 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
203 static av_cold int utvideo_encode_close(AVCodecContext *avctx)
205 UtVideoContext *utv = (UtVideoContext *)avctx->priv_data;
207 av_freep(&avctx->coded_frame);
208 av_freep(&avctx->extradata);