• 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

62 static av_cold int libx265_encode_close(AVCodecContext *avctx)
64 libx265Context *ctx = avctx->priv_data;
66 av_frame_free(&avctx->coded_frame);
76 static av_cold int libx265_encode_init(AVCodecContext *avctx)
78 libx265Context *ctx = avctx->priv_data;
84 if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL &&
85 !av_pix_fmt_desc_get(avctx->pix_fmt)->log2_chroma_w) {
86 av_log(avctx, AV_LOG_ERROR,
92 avctx->coded_frame = av_frame_alloc();
93 if (!avctx->coded_frame) {
94 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
100 av_log(avctx, AV_LOG_ERROR, "Could not allocate x265 param structure.\n");
105 av_log(avctx, AV_LOG_ERROR, "Invalid preset or tune.\n");
109 ctx->params->frameNumThreads = avctx->thread_count;
110 ctx->params->fpsNum = avctx->time_base.den;
111 ctx->params->fpsDenom = avctx->time_base.num * avctx->ticks_per_frame;
112 ctx->params->sourceWidth = avctx->width;
113 ctx->params->sourceHeight = avctx->height;
115 if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) {
117 avctx->sample_aspect_ratio.num,
118 avctx->sample_aspect_ratio.den, 65535);
121 av_log(avctx, AV_LOG_ERROR, "Invalid SAR: %d:%d.\n", sar_num, sar_den);
126 switch (avctx->pix_fmt) {
141 if (avctx->bit_rate > 0) {
142 ctx->params->rc.bitrate = avctx->bit_rate / 1000;
146 if (!(avctx->flags & CODEC_FLAG_GLOBAL_HEADER))
159 av_log(avctx, AV_LOG_WARNING,
163 av_log(avctx, AV_LOG_WARNING,
176 av_log(avctx, AV_LOG_ERROR, "Cannot open libx265 encoder.\n");
177 libx265_encode_close(avctx);
181 if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
182 avctx->extradata_size = x265_encoder_headers(ctx->encoder, &nal, &nnal);
183 if (avctx->extradata_size <= 0) {
184 av_log(avctx, AV_LOG_ERROR, "Cannot encode headers.\n");
185 libx265_encode_close(avctx);
189 avctx->extradata = av_malloc(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
190 if (!avctx->extradata) {
191 av_log(avctx, AV_LOG_ERROR,
192 "Cannot allocate HEVC header of size %d.\n", avctx->extradata_size);
193 libx265_encode_close(avctx);
197 memcpy(avctx->extradata, nal[0].payload, avctx->extradata_size);
203 static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
206 libx265Context *ctx = avctx->priv_data;
225 x265pic.bitDepth = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth_minus1 + 1;
241 av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");