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

54                               AVCodecContext* avc_context,
59 int newsize = avc_context->extradata_size + 2 + packet->bytes;
65 } else if (newsize < avc_context->extradata_size) {
68 newdata = av_realloc(avc_context->extradata, newsize);
73 av_log(avc_context, AV_LOG_ERROR, "concatenate_packet failed: %s\n", message);
77 avc_context->extradata = newdata;
78 avc_context->extradata_size = newsize;
79 AV_WB16(avc_context->extradata + (*offset), packet->bytes);
81 memcpy(avc_context->extradata + (*offset), packet->packet, packet->bytes);
152 static av_cold int encode_init(AVCodecContext* avc_context)
158 TheoraContext *h = avc_context->priv_data;
159 uint32_t gop_size = avc_context->gop_size;
163 t_info.frame_width = FFALIGN(avc_context->width, 16);
164 t_info.frame_height = FFALIGN(avc_context->height, 16);
165 t_info.pic_width = avc_context->width;
166 t_info.pic_height = avc_context->height;
171 t_info.fps_numerator = avc_context->time_base.den;
172 t_info.fps_denominator = avc_context->time_base.num;
173 if (avc_context->sample_aspect_ratio.num) {
174 t_info.aspect_numerator = avc_context->sample_aspect_ratio.num;
175 t_info.aspect_denominator = avc_context->sample_aspect_ratio.den;
181 if (avc_context->color_primaries == AVCOL_PRI_BT470M)
183 else if (avc_context->color_primaries == AVCOL_PRI_BT470BG)
188 if (avc_context->pix_fmt == PIX_FMT_YUV420P)
190 else if (avc_context->pix_fmt == PIX_FMT_YUV422P)
192 else if (avc_context->pix_fmt == PIX_FMT_YUV444P)
195 av_log(avc_context, AV_LOG_ERROR, "Unsupported pix_fmt\n");
198 avcodec_get_chroma_sub_sample(avc_context->pix_fmt, &h->uv_hshift, &h->uv_vshift);
200 if (avc_context->flags & CODEC_FLAG_QSCALE) {
206 t_info.quality = av_clip(avc_context->global_quality / (float)FF_QP2LAMBDA, 0, 10) * 6.3;
209 t_info.target_bitrate = avc_context->bit_rate;
216 av_log(avc_context, AV_LOG_ERROR, "theora_encode_init failed\n");
226 av_log(avc_context, AV_LOG_ERROR, "Error setting GOP size\n");
231 if (avc_context->flags & CODEC_FLAG_PASS1) {
232 if (get_stats(avc_context, 0))
234 } else if (avc_context->flags & CODEC_FLAG_PASS2) {
235 if (submit_stats(avc_context))
252 if (concatenate_packet(&offset, avc_context, &o_packet))
258 avc_context->coded_frame= avcodec_alloc_frame();
263 static int encode_frame(AVCodecContext* avc_context, uint8_t *outbuf,
267 TheoraContext *h = avc_context->priv_data;
275 if (avc_context->flags & CODEC_FLAG_PASS1)
276 if (get_stats(avc_context, 1))
283 t_yuv_buffer[i].width = FFALIGN(avc_context->width, 16) >> (i && h->uv_hshift);
284 t_yuv_buffer[i].height = FFALIGN(avc_context->height, 16) >> (i && h->uv_vshift);
289 if (avc_context->flags & CODEC_FLAG_PASS2)
290 if (submit_stats(avc_context))
308 av_log(avc_context, AV_LOG_ERROR, "theora_encode_YUVin failed (%s) [%d]\n", message, result);
312 if (avc_context->flags & CODEC_FLAG_PASS1)
313 if (get_stats(avc_context, 0))
326 av_log(avc_context, AV_LOG_ERROR, "theora_encode_packetout failed [%d]\n", result);
332 av_log(avc_context, AV_LOG_ERROR, "encoded frame too large\n");
339 avc_context->coded_frame->pts = frame->pts;
340 avc_context->coded_frame->key_frame = !(o_packet.granulepos & h->keyframe_mask);
345 static av_cold int encode_close(AVCodecContext* avc_context)
347 TheoraContext *h = avc_context->priv_data;
351 av_freep(&avc_context->coded_frame);
352 av_freep(&avc_context->stats_out);
353 av_freep(&avc_context->extradata);
354 avc_context->extradata_size = 0;