• 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:avc_context

57                               AVCodecContext* avc_context,
61 int newsize = avc_context->extradata_size + 2 + packet->bytes;
68 } else if (newsize < avc_context->extradata_size) {
71 if ((err = av_reallocp(&avc_context->extradata, newsize)) < 0) {
72 avc_context->extradata_size = 0;
77 av_log(avc_context, AV_LOG_ERROR, "concatenate_packet failed: %s\n", message);
81 avc_context->extradata_size = newsize;
82 AV_WB16(avc_context->extradata + (*offset), packet->bytes);
84 memcpy(avc_context->extradata + (*offset), packet->packet, packet->bytes);
155 static av_cold int encode_init(AVCodecContext* avc_context)
161 TheoraContext *h = avc_context->priv_data;
162 uint32_t gop_size = avc_context->gop_size;
167 t_info.frame_width = FFALIGN(avc_context->width, 16);
168 t_info.frame_height = FFALIGN(avc_context->height, 16);
169 t_info.pic_width = avc_context->width;
170 t_info.pic_height = avc_context->height;
175 t_info.fps_numerator = avc_context->time_base.den;
176 t_info.fps_denominator = avc_context->time_base.num;
177 if (avc_context->sample_aspect_ratio.num) {
178 t_info.aspect_numerator = avc_context->sample_aspect_ratio.num;
179 t_info.aspect_denominator = avc_context->sample_aspect_ratio.den;
185 if (avc_context->color_primaries == AVCOL_PRI_BT470M)
187 else if (avc_context->color_primaries == AVCOL_PRI_BT470BG)
192 if (avc_context->pix_fmt == AV_PIX_FMT_YUV420P)
194 else if (avc_context->pix_fmt == AV_PIX_FMT_YUV422P)
196 else if (avc_context->pix_fmt == AV_PIX_FMT_YUV444P)
199 av_log(avc_context, AV_LOG_ERROR, "Unsupported pix_fmt\n");
202 avcodec_get_chroma_sub_sample(avc_context->pix_fmt, &h->uv_hshift, &h->uv_vshift);
204 if (avc_context->flags & CODEC_FLAG_QSCALE) {
210 t_info.quality = av_clipf(avc_context->global_quality / (float)FF_QP2LAMBDA, 0, 10) * 6.3;
213 t_info.target_bitrate = avc_context->bit_rate;
220 av_log(avc_context, AV_LOG_ERROR, "theora_encode_init failed\n");
230 av_log(avc_context, AV_LOG_ERROR, "Error setting GOP size\n");
235 if (avc_context->flags & CODEC_FLAG_PASS1) {
236 if ((ret = get_stats(avc_context, 0)) < 0)
238 } else if (avc_context->flags & CODEC_FLAG_PASS2) {
239 if ((ret = submit_stats(avc_context)) < 0)
256 if ((ret = concatenate_packet(&offset, avc_context, &o_packet)) < 0)
262 avc_context->coded_frame = av_frame_alloc();
267 static int encode_frame(AVCodecContext* avc_context, AVPacket *pkt,
271 TheoraContext *h = avc_context->priv_data;
278 if (avc_context->flags & CODEC_FLAG_PASS1)
279 if ((ret = get_stats(avc_context, 1)) < 0)
286 t_yuv_buffer[i].width = FFALIGN(avc_context->width, 16) >> (i && h->uv_hshift);
287 t_yuv_buffer[i].height = FFALIGN(avc_context->height, 16) >> (i && h->uv_vshift);
292 if (avc_context->flags & CODEC_FLAG_PASS2)
293 if ((ret = submit_stats(avc_context)) < 0)
311 av_log(avc_context, AV_LOG_ERROR, "theora_encode_YUVin failed (%s) [%d]\n", message, result);
315 if (avc_context->flags & CODEC_FLAG_PASS1)
316 if ((ret = get_stats(avc_context, 0)) < 0)
329 av_log(avc_context, AV_LOG_ERROR, "theora_encode_packetout failed [%d]\n", result);
334 if ((ret = ff_alloc_packet2(avc_context, pkt, o_packet.bytes)) < 0)
341 avc_context->coded_frame->key_frame = !(o_packet.granulepos & h->keyframe_mask);
342 if (avc_context->coded_frame->key_frame)
349 static av_cold int encode_close(AVCodecContext* avc_context)
351 TheoraContext *h = avc_context->priv_data;
355 av_freep(&avc_context->coded_frame);
356 av_freep(&avc_context->stats_out);
357 av_freep(&avc_context->extradata);
358 avc_context->extradata_size = 0;