Commit 43e5e3c0 authored by Vittorio Giovara's avatar Vittorio Giovara Committed by Michael Niedermayer

colormatrix: Accept bt601 aliases as input

As far as matrix coefficients are concerned, BT470BG and SMPTE170M
match BT601. This is similar to the check performed in vf_scale.
Signed-off-by: 's avatarVittorio Giovara <vittorio.giovara@gmail.com>
parent b9de1303
...@@ -82,6 +82,8 @@ static const AVOption colormatrix_options[] = { ...@@ -82,6 +82,8 @@ static const AVOption colormatrix_options[] = {
{ "bt709", "set BT.709 colorspace", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_BT709}, .flags=FLAGS, .unit="color_mode" }, { "bt709", "set BT.709 colorspace", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_BT709}, .flags=FLAGS, .unit="color_mode" },
{ "fcc", "set FCC colorspace ", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_FCC}, .flags=FLAGS, .unit="color_mode" }, { "fcc", "set FCC colorspace ", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_FCC}, .flags=FLAGS, .unit="color_mode" },
{ "bt601", "set BT.601 colorspace", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_BT601}, .flags=FLAGS, .unit="color_mode" }, { "bt601", "set BT.601 colorspace", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_BT601}, .flags=FLAGS, .unit="color_mode" },
{ "bt470", "set BT.470 colorspace", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_BT601}, .flags=FLAGS, .unit="color_mode" },
{ "smpte170m", "set SMTPE-170M colorspace", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_BT601}, .flags=FLAGS, .unit="color_mode" },
{ "smpte240m", "set SMPTE-240M colorspace", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_SMPTE240M}, .flags=FLAGS, .unit="color_mode" }, { "smpte240m", "set SMPTE-240M colorspace", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_SMPTE240M}, .flags=FLAGS, .unit="color_mode" },
{ NULL } { NULL }
}; };
...@@ -351,6 +353,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) ...@@ -351,6 +353,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
case AVCOL_SPC_FCC : source = COLOR_MODE_FCC ; break; case AVCOL_SPC_FCC : source = COLOR_MODE_FCC ; break;
case AVCOL_SPC_SMPTE240M : source = COLOR_MODE_SMPTE240M ; break; case AVCOL_SPC_SMPTE240M : source = COLOR_MODE_SMPTE240M ; break;
case AVCOL_SPC_BT470BG : source = COLOR_MODE_BT601 ; break; case AVCOL_SPC_BT470BG : source = COLOR_MODE_BT601 ; break;
case AVCOL_SPC_SMPTE170M : source = COLOR_MODE_BT601 ; break;
default : default :
av_log(ctx, AV_LOG_ERROR, "Input frame does not specify a supported colorspace, and none has been specified as source either\n"); av_log(ctx, AV_LOG_ERROR, "Input frame does not specify a supported colorspace, and none has been specified as source either\n");
av_frame_free(&out); av_frame_free(&out);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment