diff options
author | James Almer <jamrial@gmail.com> | 2022-07-18 15:36:14 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-08-02 09:56:27 -0300 |
commit | b0cd979a0b6489f54939e0d1fc7527ebdacb6119 (patch) | |
tree | 1dfc321b2856d6b04176c8b352a356ffa170cb87 /libavcodec/libaomdec.c | |
parent | c6f22940e442ac2d2142ec9dce7ed8474c97aad2 (diff) |
avcodec/libaomenc: support AV_CODEC_CAP_ENCODER_RECON_FRAME
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/libaomdec.c')
-rw-r--r-- | libavcodec/libaomdec.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c index 3243610304..cb672b0e65 100644 --- a/libavcodec/libaomdec.c +++ b/libavcodec/libaomdec.c @@ -33,6 +33,7 @@ #include "avcodec.h" #include "codec_internal.h" #include "internal.h" +#include "libaom.h" #include "profiles.h" typedef struct AV1DecodeContext { @@ -60,30 +61,6 @@ static av_cold int aom_init(AVCodecContext *avctx, return 0; } -static void image_copy_16_to_8(AVFrame *pic, struct aom_image *img) -{ - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pic->format); - int i; - - for (i = 0; i < desc->nb_components; i++) { - int w = img->d_w; - int h = img->d_h; - int x, y; - - if (i) { - w = (w + img->x_chroma_shift) >> img->x_chroma_shift; - h = (h + img->y_chroma_shift) >> img->y_chroma_shift; - } - - for (y = 0; y < h; y++) { - uint16_t *src = (uint16_t *)(img->planes[i] + y * img->stride[i]); - uint8_t *dst = pic->data[i] + y * pic->linesize[i]; - for (x = 0; x < w; x++) - *dst++ = *src++; - } - } -} - // returns 0 on success, AVERROR_INVALIDDATA otherwise static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img) { @@ -223,7 +200,7 @@ static int aom_decode(AVCodecContext *avctx, AVFrame *picture, 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); + ff_aom_image_copy_16_to_8(picture, img); else { const uint8_t *planes[4] = { img->planes[0], img->planes[1], img->planes[2] }; const int stride[4] = { img->stride[0], img->stride[1], img->stride[2] }; |