aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/av1_parser.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2020-06-19 10:56:20 -0300
committerJames Almer <jamrial@gmail.com>2020-06-19 11:05:30 -0300
commitaf6cddae1fe9cf378e961d9a2a36dd7234996ab3 (patch)
tree85bbf0fd9af23f2332c45ee29d06fd0b87e4dd46 /libavcodec/av1_parser.c
parent634a44db5a621e59079fbeb00ec62f2f6c9fdd8b (diff)
downloadffmpeg-af6cddae1fe9cf378e961d9a2a36dd7234996ab3.tar.gz
avcodec/av1_parser: add missing parsing for RGB pixel format signaling
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/av1_parser.c')
-rw-r--r--libavcodec/av1_parser.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
index ce447a67e9..c5bdc6b25f 100644
--- a/libavcodec/av1_parser.c
+++ b/libavcodec/av1_parser.c
@@ -45,6 +45,10 @@ static const enum AVPixelFormat pix_fmts_12bit[2][2] = {
{ AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV420P12 },
};
+static const enum AVPixelFormat pix_fmts_rgb[3] = {
+ AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12,
+};
+
static int av1_parser_parse(AVCodecParserContext *ctx,
AVCodecContext *avctx,
const uint8_t **out_data, int *out_size,
@@ -161,6 +165,12 @@ static int av1_parser_parse(AVCodecParserContext *ctx,
}
av_assert2(ctx->format != AV_PIX_FMT_NONE);
+ if (!color->subsampling_x && !color->subsampling_y &&
+ color->matrix_coefficients == AVCOL_SPC_RGB &&
+ color->color_primaries == AVCOL_PRI_BT709 &&
+ color->transfer_characteristics == AVCOL_TRC_IEC61966_2_1)
+ ctx->format = pix_fmts_rgb[color->high_bitdepth + color->twelve_bit];
+
avctx->profile = seq->seq_profile;
avctx->level = seq->seq_level_idx[0];