diff options
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] }; |