Lines Matching defs:avctx

63     AVCodecContext *avctx;
356 av_log(s->avctx, AV_LOG_WARNING, "overread\n");
358 av_log(s->avctx, AV_LOG_WARNING, "underread: %d\n", get_bits_left(gb));
424 int h = s->avctx->coded_height >> !shift;
425 int w = s->avctx->coded_width >> !shift;
457 int h = s->avctx->coded_height >> !shift;
458 int w = s->avctx->coded_width >> !shift;
528 av_log(s->avctx, AV_LOG_WARNING, "overread\n");
530 av_log(s->avctx, AV_LOG_WARNING, "underread: %d\n", get_bits_left(gb));
574 static int decode_raw_intra_rgb(AVCodecContext *avctx, GetByteContext *gbyte, AVFrame *frame)
576 uint8_t *dst = frame->data[0] + (avctx->height - 1) * frame->linesize[0];
579 if (bytestream2_get_bytes_left(gbyte) < 3 * avctx->width * avctx->height)
582 for (int y = 0; y < avctx->height; y++) {
583 for (int x = 0; x < avctx->width; x++) {
662 static int decode_runlen_rgb(AVCodecContext *avctx, GetByteContext *gbyte, AVFrame *frame)
664 uint8_t *dst = frame->data[0] + (avctx->height - 1) * frame->linesize[0];
715 static int decode_runlen(AVCodecContext *avctx, GetByteContext *gbyte, AVFrame *frame)
717 uint8_t *y0dst = frame->data[0] + (avctx->height - 1) * frame->linesize[0];
719 uint8_t *udst = frame->data[1] + ((avctx->height >> 1) - 1) * frame->linesize[1];
720 uint8_t *vdst = frame->data[2] + ((avctx->height >> 1) - 1) * frame->linesize[2];
743 avctx->width / 2,
744 avctx->height / 2))
756 avctx->width / 2,
757 avctx->height / 2))
765 static int decode_raw_intra(AVCodecContext *avctx, GetByteContext *gbyte, AVFrame *frame)
767 uint8_t *y0dst = frame->data[0] + (avctx->height - 1) * frame->linesize[0];
769 uint8_t *udst = frame->data[1] + ((avctx->height >> 1) - 1) * frame->linesize[1];
770 uint8_t *vdst = frame->data[2] + ((avctx->height >> 1) - 1) * frame->linesize[2];
773 for (int y = 0; y < avctx->height / 2; y++) {
774 for (int x = 0; x < avctx->width / 2; x++) {
798 static int decode_intra(AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame)
800 AGMContext *s = avctx->priv_data;
805 s->blocks_w = avctx->coded_width >> 3;
806 s->blocks_h = avctx->coded_height >> 3;
814 s->blocks_w = avctx->coded_width >> 4;
815 s->blocks_h = avctx->coded_height >> 4;
823 s->blocks_w = avctx->coded_width >> 4;
824 s->blocks_h = avctx->coded_height >> 4;
833 static int decode_motion_vectors(AVCodecContext *avctx, GetBitContext *gb)
835 AGMContext *s = avctx->priv_data;
836 int nb_mvs = ((avctx->coded_height + 15) >> 4) * ((avctx->coded_width + 15) >> 4);
874 static int decode_inter(AVCodecContext *avctx, GetBitContext *gb,
877 AGMContext *s = avctx->priv_data;
883 ret = decode_motion_vectors(avctx, gb);
888 s->blocks_w = avctx->coded_width >> 3;
889 s->blocks_h = avctx->coded_height >> 3;
897 s->blocks_w = avctx->coded_width >> 4;
898 s->blocks_h = avctx->coded_height >> 4;
906 s->blocks_w = avctx->coded_width >> 4;
907 s->blocks_h = avctx->coded_height >> 4;
1045 static int decode_huffman2(AVCodecContext *avctx, int header, int size)
1047 AGMContext *s = avctx->priv_data;
1058 if (s->output_size > avctx->width * avctx->height * 9LL + 10000)
1097 static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
1100 AGMContext *s = avctx->priv_data;
1117 av_log(avctx, AV_LOG_DEBUG, "fflags: %X\n", s->fflags);
1127 av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
1133 if (avctx->codec_tag == MKTAG('A', 'G', 'M', '0') ||
1134 avctx->codec_tag == MKTAG('A', 'G', 'M', '1'))
1137 ret = decode_huffman2(avctx, header, (avpkt->size - s->bitstream_size) - 8);
1160 width = avctx->width;
1161 height = avctx->height;
1165 ret = ff_set_dimensions(avctx, w, h);
1168 avctx->width = width;
1169 avctx->height = height;
1190 if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
1195 ret = decode_raw_intra(avctx, gbyte, frame);
1197 ret = decode_raw_intra_rgb(avctx, gbyte, frame);
1199 ret = decode_intra(avctx, gb, frame);
1212 ret = decode_inter(avctx, gb, frame, s->prev_frame);
1214 ret = decode_runlen(avctx, gbyte, frame);
1216 ret = decode_runlen_rgb(avctx, gbyte, frame);
1226 frame->crop_top = avctx->coded_height - avctx->height;
1227 frame->crop_left = avctx->coded_width - avctx->width;
1234 static av_cold int decode_init(AVCodecContext *avctx)
1236 AGMContext *s = avctx->priv_data;
1238 s->rgb = avctx->codec_tag == MKTAG('A', 'G', 'M', '4');
1239 avctx->pix_fmt = s->rgb ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_YUV420P;
1240 s->avctx = avctx;
1241 s->plus = avctx->codec_tag == MKTAG('A', 'G', 'M', '3') ||
1242 avctx->codec_tag == MKTAG('A', 'G', 'M', '7');
1244 s->dct = avctx->codec_tag != MKTAG('A', 'G', 'M', '4') &&
1245 avctx->codec_tag != MKTAG('A', 'G', 'M', '5');
1248 if ((avctx->width & 1) || (avctx->height & 1))
1252 avctx->idct_algo = FF_IDCT_SIMPLE;
1253 ff_idctdsp_init(&s->idsp, avctx);
1263 static void decode_flush(AVCodecContext *avctx)
1265 AGMContext *s = avctx->priv_data;
1270 static av_cold int decode_close(AVCodecContext *avctx)
1272 AGMContext *s = avctx->priv_data;