diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-07-25 03:27:00 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-25 04:50:46 +0400 |
commit | 5156d482cd60a00e88ce1ea574a43aec79be3b2e (patch) | |
tree | 88f3e0dcdff393be904aa6e5cdba5daba7551a75 /libavfilter/vf_scale.c | |
parent | a7e45cfa11853a2a22863c8a12f96b658d04ecf5 (diff) |
avfilter/vf_scale: use the inputs color range when its set and its not overridden
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_scale.c')
-rw-r--r-- | libavfilter/vf_scale.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index d82084e9a0..874d4574be 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -392,6 +392,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) AVFrame *out; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format); char buf[32]; + int in_range; if( in->width != link->w || in->height != link->h @@ -429,9 +430,12 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) if(scale->output_is_pal) avpriv_set_systematic_pal2((uint32_t*)out->data[1], outlink->format == AV_PIX_FMT_PAL8 ? AV_PIX_FMT_BGR8 : outlink->format); + in_range = av_frame_get_color_range(in); + if ( scale->in_color_matrix || scale->out_color_matrix || scale-> in_range != AVCOL_RANGE_UNSPECIFIED + || in_range != AVCOL_RANGE_UNSPECIFIED || scale->out_range != AVCOL_RANGE_UNSPECIFIED) { int in_full, out_full, brightness, contrast, saturation; const int *inv_table, *table; @@ -447,6 +451,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) if (scale-> in_range != AVCOL_RANGE_UNSPECIFIED) in_full = (scale-> in_range == AVCOL_RANGE_JPEG); + else if (in_range != AVCOL_RANGE_UNSPECIFIED) + in_full = (in_range == AVCOL_RANGE_JPEG); if (scale->out_range != AVCOL_RANGE_UNSPECIFIED) out_full = (scale->out_range == AVCOL_RANGE_JPEG); |