X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Flibaomdec.c;h=1430a651fea1de67efa6d3e647bbb9c2eb68ceed;hb=e847cabb60a29c354512664022ad6833a907bf1b;hp=6a2de6d47a760431982e02818454c302de22d502;hpb=203bbaccfaaeac9548862e83792d38509a8c8167;p=ffmpeg diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c index 6a2de6d47a7..1430a651fea 100644 --- a/libavcodec/libaomdec.c +++ b/libavcodec/libaomdec.c @@ -42,8 +42,7 @@ 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, 16) + .threads = FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 16) }; av_log(avctx, AV_LOG_INFO, "%s\n", aom_codec_version_str()); @@ -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