Lines Matching defs:avctx

110     AVCodecContext *avctx = v->s.avctx;
116 avpriv_request_sample(avctx, "Non-zero rotation coefficients");
117 av_log(avctx, AV_LOG_DEBUG, sprite ? "S2:" : "S1:");
119 av_log(avctx, AV_LOG_DEBUG, " %d.%.3d",
122 av_log(avctx, AV_LOG_DEBUG, "\n");
141 av_log(avctx, AV_LOG_DEBUG, "Effect: %d; params: ", sd->effect_type);
143 av_log(avctx, AV_LOG_DEBUG, " %d.%.2d",
146 av_log(avctx, AV_LOG_DEBUG, "\n");
151 av_log(avctx, AV_LOG_ERROR, "Too many effect parameters\n");
155 av_log(avctx, AV_LOG_DEBUG, "Effect params 2: ");
158 av_log(avctx, AV_LOG_DEBUG, " %d.%.2d",
162 av_log(avctx, AV_LOG_DEBUG, "\n");
166 av_log(avctx, AV_LOG_DEBUG, "Effect flag set\n");
169 (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE ? 64 : 0)) {
170 av_log(avctx, AV_LOG_ERROR, "Buffer overrun\n");
174 av_log(avctx, AV_LOG_WARNING, "Buffer not fully read\n");
199 for (plane = 0; plane < (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY ? 1 : 3); plane++) {
280 AVCodecContext *avctx = s->avctx;
290 av_log(avctx, AV_LOG_ERROR, "Got no sprites\n");
295 av_log(avctx, AV_LOG_WARNING, "Need two sprites, only got one\n");
300 if ((ret = ff_get_buffer(avctx, v->sprite_output_frame, 0)) < 0)
308 static void vc1_sprite_flush(AVCodecContext *avctx)
310 VC1Context *v = avctx->priv_data;
320 for (plane = 0; plane < (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY ? 1 : 3); plane++)
388 if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
394 ret = ff_intrax8_common_init(s->avctx, &v->x8, &s->idsp,
403 ff_vc1_decode_end(s->avctx);
426 static av_cold int vc1_decode_init(AVCodecContext *avctx)
428 VC1Context *v = avctx->priv_data;
434 v->output_width = avctx->width;
435 v->output_height = avctx->height;
437 if (!avctx->extradata_size || !avctx->extradata)
439 v->s.avctx = avctx;
443 if (avctx->codec_id == AV_CODEC_ID_WMV3 || avctx->codec_id == AV_CODEC_ID_WMV3IMAGE) {
451 ret = init_get_bits8(&gb, avctx->extradata, avctx->extradata_size);
455 if ((ret = ff_vc1_decode_sequence_header(avctx, v, &gb)) < 0)
458 if (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE && !v->res_sprite) {
459 avpriv_request_sample(avctx, "Non sprite WMV3IMAGE");
463 count = avctx->extradata_size*8 - get_bits_count(&gb);
465 av_log(avctx, AV_LOG_INFO, "Extra data: %i bits left, value: %X\n",
468 av_log(avctx, AV_LOG_INFO, "Read %i bits in overflow\n", -count);
471 const uint8_t *start = avctx->extradata;
472 uint8_t *end = avctx->extradata + avctx->extradata_size;
478 if (avctx->extradata_size < 16) {
479 av_log(avctx, AV_LOG_ERROR, "Extradata size too small: %i\n", avctx->extradata_size);
483 buf2 = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
498 if ((ret = ff_vc1_decode_sequence_header(avctx, v, &gb)) < 0) {
505 if ((ret = ff_vc1_decode_entry_point(avctx, v, &gb)) < 0) {
515 av_log(avctx, AV_LOG_ERROR, "Incomplete extradata\n");
518 v->res_sprite = (avctx->codec_id == AV_CODEC_ID_VC1IMAGE);
521 avctx->profile = v->profile;
523 avctx->level = v->level;
525 if (!CONFIG_GRAY || !(avctx->flags & AV_CODEC_FLAG_GRAY))
526 avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
528 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
529 if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED)
530 avctx->color_range = AVCOL_RANGE_MPEG;
534 if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
541 ff_vc1_decode_end(avctx);
543 ff_blockdsp_init(&s->bdsp, avctx);
547 avctx->has_b_frames = !!avctx->max_b_frames;
550 avctx->color_primaries = v->color_prim;
552 avctx->color_trc = v->transfer_char;
554 avctx->colorspace = v->matrix_coef;
556 s->mb_width = (avctx->coded_width + 15) >> 4;
557 s->mb_height = (avctx->coded_height + 15) >> 4;
567 if (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
568 v->sprite_width = avctx->coded_width;
569 v->sprite_height = avctx->coded_height;
571 avctx->coded_width = avctx->width = v->output_width;
572 avctx->coded_height = avctx->height = v->output_height;
583 avpriv_request_sample(avctx, "odd sprites support");
593 av_cold int ff_vc1_decode_end(AVCodecContext *avctx)
595 VC1Context *v = avctx->priv_data;
626 static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict,
631 VC1Context *v = avctx->priv_data;
646 if(s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY)
664 if (avctx->codec_id == AV_CODEC_ID_VC1 || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
681 if (avctx->hwaccel)
687 if (avctx->hwaccel)
704 slices[n_slices].mby_start = avctx->coded_height + 31 >> 5;
714 ff_vc1_decode_entry_point(avctx, v, &s->gb);
747 av_log(avctx, AV_LOG_ERROR, "Error in WVC1 interlaced frame\n");
751 if (avctx->hwaccel)
791 if (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
794 avctx->width = avctx->coded_width = v->sprite_width;
795 avctx->height = avctx->coded_height = v->sprite_height;
803 (s->width != avctx->coded_width ||
804 s->height != avctx->coded_height)) {
805 ff_vc1_decode_end(avctx);
809 if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
816 s->low_delay = !avctx->has_b_frames || v->res_sprite;
819 if(avctx->coded_width<=1 || avctx->coded_height<=1) {
823 s->h_edge_pos = avctx->coded_width;
824 s->v_edge_pos = avctx->coded_height;
842 if (avctx->debug & FF_DEBUG_PICT_INFO)
843 av_log(v->s.avctx, AV_LOG_DEBUG, "pict_type: %c\n", av_get_picture_type_char(s->pict_type));
845 if ((avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE)
847 av_log(v->s.avctx, AV_LOG_ERROR, "Sprite decoder: expected I-frame\n");
851 if ((avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE)
853 av_log(v->s.avctx, AV_LOG_ERROR, "Sprite decoder: expected Frames not Fields\n");
858 av_log(v->s.avctx, AV_LOG_ERROR, "image too short\n");
869 av_log(v->s.avctx, AV_LOG_DEBUG, "Skipping B frame without reference frames\n");
872 if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||
873 (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) ||
874 avctx->skip_frame >= AVDISCARD_ALL) {
878 if ((ret = ff_mpv_frame_start(s, avctx)) < 0) {
901 if (avctx->hwaccel) {
906 if ((ret = avctx->hwaccel->start_frame(avctx, buf_start, buf_start_second_field - buf_start)) < 0)
911 if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, buf_start_second_field - buf_start)) < 0)
914 if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, slices[0].rawbuf - buf_start)) < 0)
924 av_log(v->s.avctx, AV_LOG_ERROR, "Slice header damaged\n");
926 if (avctx->err_recognition & AV_EF_EXPLODE)
932 if ((ret = avctx->hwaccel->decode_slice(avctx, slices[i].rawbuf, slices[i].raw_size)) < 0)
937 if ((ret = avctx->hwaccel->end_frame(avctx)) < 0)
947 av_log(avctx, AV_LOG_ERROR, "parsing header for second field failed");
953 if ((ret = avctx->hwaccel->start_frame(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field)) < 0)
958 if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field)) < 0)
961 if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start_second_field, slices[n_slices1 + 2].rawbuf - buf_start_second_field)) < 0)
971 av_log(v->s.avctx, AV_LOG_ERROR, "Slice header damaged\n");
973 if (avctx->err_recognition & AV_EF_EXPLODE)
979 if ((ret = avctx->hwaccel->decode_slice(avctx, slices[i].rawbuf, slices[i].raw_size)) < 0)
984 if ((ret = avctx->hwaccel->end_frame(avctx)) < 0)
988 if ((ret = avctx->hwaccel->start_frame(avctx, buf_start, (buf + buf_size) - buf_start)) < 0)
993 if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, (buf + buf_size) - buf_start)) < 0)
997 if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, slices[0].rawbuf - buf_start)) < 0)
1008 av_log(v->s.avctx, AV_LOG_ERROR, "Slice header damaged\n");
1010 if (avctx->err_recognition & AV_EF_EXPLODE)
1016 if ((ret = avctx->hwaccel->decode_slice(avctx, slices[i].rawbuf, slices[i].raw_size)) < 0)
1020 if ((ret = avctx->hwaccel->end_frame(avctx)) < 0)
1043 av_log(v->s.avctx, AV_LOG_ERROR, "Slice %d starts beyond "
1061 av_log(v->s.avctx, AV_LOG_ERROR, "Field header damaged\n");
1063 if (avctx->err_recognition & AV_EF_EXPLODE)
1070 av_log(v->s.avctx, AV_LOG_ERROR, "Slice header damaged\n");
1072 if (avctx->err_recognition & AV_EF_EXPLODE)
1085 av_log(v->s.avctx, AV_LOG_ERROR, "first field slice count too large\n");
1091 av_log(v->s.avctx, AV_LOG_ERROR, "end mb y %d %d invalid\n", s->end_mb_y, s->start_mb_y);
1097 av_log(v->s.avctx, AV_LOG_ERROR, "missing cbpcy_vlc\n");
1117 ff_dlog(s->avctx, "Consumed %i/%i bits\n",
1126 && avctx->codec_id != AV_CODEC_ID_WMV3IMAGE
1127 && avctx->codec_id != AV_CODEC_ID_VC1IMAGE)
1133 if (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
1135 avctx->width = avctx->coded_width = v->output_width;
1136 avctx->height = avctx->coded_height = v->output_height;
1137 if (avctx->skip_frame >= AVDISCARD_NONREF)