diff options
author | James Almer <jamrial@gmail.com> | 2018-12-12 06:06:05 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2018-12-12 06:07:13 +0300 |
commit | 0e833f615b59cd7611374d1d77257eaf00635ad7 (patch) | |
tree | b7508e11367dffae39e1a0194635146e23521ef0 /libavcodec/libdav1d.c | |
parent | 1046cba24be41c624489f40513aeaba7e52ca9ff (diff) |
avcodec/libdav1d: add support for 12bit streams
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/libdav1d.c')
-rw-r--r-- | libavcodec/libdav1d.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index 52a7c10617..7f0b96e0cd 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -79,11 +79,11 @@ static void libdav1d_frame_free(void *opaque, uint8_t *data) { dav1d_picture_unref(&p); } -static const enum AVPixelFormat pix_fmt[][2] = { - [DAV1D_PIXEL_LAYOUT_I400] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY10 }, - [DAV1D_PIXEL_LAYOUT_I420] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10 }, - [DAV1D_PIXEL_LAYOUT_I422] = { AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P10 }, - [DAV1D_PIXEL_LAYOUT_I444] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P10 }, +static const enum AVPixelFormat pix_fmt[][3] = { + [DAV1D_PIXEL_LAYOUT_I400] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12 }, + [DAV1D_PIXEL_LAYOUT_I420] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV420P12 }, + [DAV1D_PIXEL_LAYOUT_I422] = { AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12 }, + [DAV1D_PIXEL_LAYOUT_I444] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12 }, }; static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) @@ -151,7 +151,7 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) frame->linesize[2] = p.stride[1]; c->profile = p.seq_hdr->profile; - frame->format = c->pix_fmt = pix_fmt[p.p.layout][p.p.bpc == 10]; + frame->format = c->pix_fmt = pix_fmt[p.p.layout][p.seq_hdr->hbd]; frame->width = p.p.w; frame->height = p.p.h; if (c->width != p.p.w || c->height != p.p.h) { |