Lines Matching defs:avctx

57 int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx)
59 H264Context *h = avctx->priv_data;
82 av_log(h->avctx, AV_LOG_DEBUG, "Reference not available for error concealing\n");
86 av_log(h->avctx, AV_LOG_DEBUG, "Reference invalid\n");
102 AVCodecContext *avctx = h->avctx;
104 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
112 height = FFMIN(height, avctx->height - y);
114 if (field_pic && h->first_field && !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD))
117 if (avctx->draw_horiz_band) {
129 avctx->draw_horiz_band(avctx, src, offset,
221 er->avctx = h->avctx;
283 static int h264_init_context(AVCodecContext *avctx, H264Context *h)
287 h->avctx = avctx;
290 h->width_from_caller = avctx->width;
291 h->height_from_caller = avctx->height;
293 h->workaround_bugs = avctx->workaround_bugs;
294 h->flags = avctx->flags;
308 h->nb_slice_ctx = (avctx->active_thread_type & FF_THREAD_SLICE) ? avctx->thread_count : 1;
339 static av_cold int h264_decode_end(AVCodecContext *avctx)
341 H264Context *h = avctx->priv_data;
370 static av_cold int h264_decode_init(AVCodecContext *avctx)
372 H264Context *h = avctx->priv_data;
375 ret = h264_init_context(avctx, h);
381 av_log(avctx, AV_LOG_ERROR, "pthread_once has failed.");
385 if (avctx->ticks_per_frame == 1) {
386 if(h->avctx->time_base.den < INT_MAX/2) {
387 h->avctx->time_base.den *= 2;
389 h->avctx->time_base.num /= 2;
391 avctx->ticks_per_frame = 2;
393 if (!avctx->internal->is_copy) {
394 if (avctx->extradata_size > 0 && avctx->extradata) {
395 ret = ff_h264_decode_extradata(avctx->extradata, avctx->extradata_size,
397 avctx->err_recognition, avctx);
399 int explode = avctx->err_recognition & AV_EF_EXPLODE;
400 av_log(avctx, explode ? AV_LOG_ERROR: AV_LOG_WARNING,
411 h->avctx->has_b_frames < h->ps.sps->num_reorder_frames) {
412 h->avctx->has_b_frames = h->ps.sps->num_reorder_frames;
417 if (h->enable_er < 0 && (avctx->active_thread_type & FF_THREAD_SLICE))
420 if (h->enable_er && (avctx->active_thread_type & FF_THREAD_SLICE)) {
421 av_log(avctx, AV_LOG_WARNING,
470 static void h264_decode_flush(AVCodecContext *avctx)
472 H264Context *h = avctx->priv_data;
517 av_log(h->avctx, AV_LOG_ERROR, "Invalid zero-sized VCL NAL unit\n");
518 if (h->avctx->err_recognition & AV_EF_EXPLODE)
575 AVCodecContext *const avctx = h->avctx;
583 if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) {
598 ret = ff_h2645_packet_split(&h->pkt, buf, buf_size, avctx, h->is_avc, h->nal_length_size,
599 avctx->codec_id, 0, 0);
601 av_log(avctx, AV_LOG_ERROR,
606 if (avctx->active_thread_type & FF_THREAD_FRAME)
615 if (avctx->skip_frame >= AVDISCARD_NONREF &&
627 av_log(h->avctx, AV_LOG_ERROR, "Invalid inter IDR frame\n");
647 if (avctx->active_thread_type & FF_THREAD_FRAME &&
649 ff_thread_finish_setup(avctx);
653 if (h->avctx->hwaccel &&
654 (ret = h->avctx->hwaccel->start_frame(h->avctx, buf, buf_size)) < 0)
658 max_slice_ctx = avctx->hwaccel ? 1 : h->nb_slice_ctx;
660 if (h->avctx->hwaccel) {
661 ret = avctx->hwaccel->decode_slice(avctx, nal->raw_data, nal->raw_size);
665 if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
672 avpriv_request_sample(avctx, "data partitioning");
676 avpriv_request_sample(avctx, "Late SEI");
679 ret = ff_h264_sei_decode(&h->sei, &nal->gb, &h->ps, avctx);
681 if (avctx->debug & FF_DEBUG_GREEN_MD)
682 debug_green_metadata(&h->sei.green_metadata, h->avctx);
683 if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
688 if (avctx->hwaccel && avctx->hwaccel->decode_params) {
689 ret = avctx->hwaccel->decode_params(avctx,
696 if (ff_h264_decode_seq_parameter_set(&tmp_gb, avctx, &h->ps, 0) >= 0)
698 av_log(h->avctx, AV_LOG_DEBUG,
701 if (ff_h264_decode_seq_parameter_set(&tmp_gb, avctx, &h->ps, 0) >= 0)
703 ff_h264_decode_seq_parameter_set(&nal->gb, avctx, &h->ps, 1);
707 if (avctx->hwaccel && avctx->hwaccel->decode_params) {
708 ret = avctx->hwaccel->decode_params(avctx,
715 ret = ff_h264_decode_picture_parameter_set(&nal->gb, avctx, &h->ps,
717 if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
728 av_log(avctx, AV_LOG_DEBUG, "Unknown NAL code: %d (%d bits)\n",
733 av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\n");
738 if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
860 if (h->avctx->export_side_data & AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS) {
866 if (!(h->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN))
903 if (((h->avctx->flags & AV_CODEC_FLAG_OUTPUT_CORRUPT) ||
904 (h->avctx->flags2 & AV_CODEC_FLAG2_SHOW_ALL) ||
907 if (!h->avctx->hwaccel &&
918 av_log(h->avctx, AV_LOG_DEBUG, "Duplicating field %d to fill missing\n", field);
937 ff_print_debug_info2(h->avctx, dst, NULL,
981 static int h264_decode_frame(AVCodecContext *avctx, AVFrame *pict,
986 H264Context *h = avctx->priv_data;
990 h->flags = avctx->flags;
1005 avctx->err_recognition, avctx);
1011 avctx->err_recognition, avctx);
1023 if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS) && (!h->cur_pic_ptr || !h->has_slice)) {
1024 if (avctx->skip_frame >= AVDISCARD_NONREF ||
1027 av_log(avctx, AV_LOG_ERROR, "no frame!\n");
1031 if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS) ||