Lines Matching defs:avctx

42 static av_cold int aom_init(AVCodecContext *avctx,
45 AV1DecodeContext *ctx = avctx->priv_data;
47 .threads = FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 16)
50 av_log(avctx, AV_LOG_INFO, "%s\n", aom_codec_version_str());
51 av_log(avctx, AV_LOG_VERBOSE, "%s\n", aom_codec_build_config());
55 av_log(avctx, AV_LOG_ERROR, "Failed to initialize decoder: %s\n",
88 static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
93 avctx->color_range = color_ranges[img->range];
94 avctx->color_primaries = img->cp;
95 avctx->colorspace = img->mc;
96 avctx->color_trc = img->tc;
102 avctx->pix_fmt = img->monochrome ?
104 avctx->profile = FF_PROFILE_AV1_MAIN;
107 avctx->pix_fmt = img->monochrome ?
109 avctx->profile = FF_PROFILE_AV1_MAIN;
112 avctx->pix_fmt = img->monochrome ?
114 avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
122 avctx->pix_fmt = AV_PIX_FMT_YUV422P;
123 avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
126 avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
127 avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
130 avctx->pix_fmt = AV_PIX_FMT_YUV422P12;
131 avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
139 avctx->pix_fmt = AV_PIX_FMT_YUV444P;
140 avctx->profile = FF_PROFILE_AV1_HIGH;
143 avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
144 avctx->profile = FF_PROFILE_AV1_HIGH;
147 avctx->pix_fmt = AV_PIX_FMT_YUV444P12;
148 avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
159 static int aom_decode(AVCodecContext *avctx, AVFrame *picture,
162 AV1DecodeContext *ctx = avctx->priv_data;
172 av_log(avctx, AV_LOG_ERROR, "Failed to decode frame: %s\n", error);
174 av_log(avctx, AV_LOG_ERROR, " Additional information: %s\n",
181 av_log(avctx, AV_LOG_ERROR, "Display dimensions %dx%d exceed storage %dx%d\n",
186 if ((ret = set_pix_fmt(avctx, img)) < 0) {
187 av_log(avctx, AV_LOG_ERROR, "Unsupported output colorspace (%d) / bit_depth (%d)\n",
192 if ((int)img->d_w != avctx->width || (int)img->d_h != avctx->height) {
193 av_log(avctx, AV_LOG_INFO, "dimension change! %dx%d -> %dx%d\n",
194 avctx->width, avctx->height, img->d_w, img->d_h);
195 ret = ff_set_dimensions(avctx, img->d_w, img->d_h);
199 if ((ret = ff_get_buffer(avctx, picture, 0)) < 0)
223 ff_set_sar(avctx, picture->sample_aspect_ratio);
232 stride, avctx->pix_fmt, img->d_w, img->d_h);
239 static av_cold int aom_free(AVCodecContext *avctx)
241 AV1DecodeContext *ctx = avctx->priv_data;
246 static av_cold int av1_init(AVCodecContext *avctx)
248 return aom_init(avctx, aom_codec_av1_dx());