X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Flibaomdec.c;h=1fc0a0001d90633a61f3fae69b0f39cc33356717;hb=8ffd3ef9d94f33b411348c594a49d994b55c9550;hp=2530c9f76b4ada03fc1325b81c588467e211f340;hpb=1b98bfb932ad36667ea7f18e24c54978623f6654;p=ffmpeg diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c index 2530c9f76b4..1fc0a0001d9 100644 --- a/libavcodec/libaomdec.c +++ b/libavcodec/libaomdec.c @@ -42,7 +42,6 @@ static av_cold int aom_init(AVCodecContext *avctx, { AV1DecodeContext *ctx = avctx->priv_data; struct aom_codec_dec_cfg deccfg = { - /* token partitions+1 would be a decent choice */ .threads = FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 16) }; @@ -198,6 +197,14 @@ static int aom_decode(AVCodecContext *avctx, void *data, int *got_frame, } if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) return ret; + + av_reduce(&picture->sample_aspect_ratio.num, + &picture->sample_aspect_ratio.den, + picture->height * img->r_w, + picture->width * img->r_h, + INT_MAX); + ff_set_sar(avctx, picture->sample_aspect_ratio); + if ((img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) && img->bit_depth == 8) image_copy_16_to_8(picture, img); else @@ -229,7 +236,8 @@ AVCodec ff_libaom_av1_decoder = { .init = av1_init, .close = aom_free, .decode = aom_decode, - .capabilities = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_AUTO_THREADS, .profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), .wrapper_name = "libaom", };