Re: [FFmpeg-devel] [PATCH 05/27] avfilter/vf_scale: make use of color_range from filter links

2017-12-10 Thread Paul B Mahol
On 12/10/17, Michael Niedermayer  wrote:
> On Sat, Dec 09, 2017 at 04:37:57PM +0100, Paul B Mahol wrote:
>> Signed-off-by: Paul B Mahol 
>> ---
>>  libavfilter/vf_scale.c | 8 
>>  1 file changed, 8 insertions(+)
>
> This changes the output for:
>
> ./ffmpeg -i ~/tickets/2939/lena.jpg -y file.jpg
>
> Not sure if its more correct before or after the patch

It should be more correct.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 05/27] avfilter/vf_scale: make use of color_range from filter links

2017-12-10 Thread Michael Niedermayer
On Sat, Dec 09, 2017 at 04:37:57PM +0100, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavfilter/vf_scale.c | 8 
>  1 file changed, 8 insertions(+)

This changes the output for:

./ffmpeg -i ~/tickets/2939/lena.jpg -y file.jpg

Not sure if its more correct before or after the patch

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 05/27] avfilter/vf_scale: make use of color_range from filter links

2017-12-09 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/vf_scale.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 9f45032e85..802f841cc3 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -303,9 +303,15 @@ static int config_props(AVFilterLink *outlink)
 if (scale->in_range != AVCOL_RANGE_UNSPECIFIED)
 av_opt_set_int(*s, "src_range",
scale->in_range == AVCOL_RANGE_JPEG, 0);
+else
+av_opt_set_int(*s, "src_range",
+   inlink->color_range == AVCOL_RANGE_JPEG, 0);
 if (scale->out_range != AVCOL_RANGE_UNSPECIFIED)
 av_opt_set_int(*s, "dst_range",
scale->out_range == AVCOL_RANGE_JPEG, 0);
+   else
+av_opt_set_int(*s, "dst_range",
+   outlink->color_range == AVCOL_RANGE_JPEG, 0);
 
 if (scale->opts) {
 AVDictionaryEntry *e = NULL;
@@ -416,6 +422,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
 if(   in->width  != link->w
|| in->height != link->h
|| in->format != link->format
+   || in->color_range != link->color_range
|| in->sample_aspect_ratio.den != link->sample_aspect_ratio.den || 
in->sample_aspect_ratio.num != link->sample_aspect_ratio.num) {
 int ret;
 
@@ -429,6 +436,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
 link->dst->inputs[0]->format = in->format;
 link->dst->inputs[0]->w  = in->width;
 link->dst->inputs[0]->h  = in->height;
+link->dst->inputs[0]->color_range = in->color_range;
 
 link->dst->inputs[0]->sample_aspect_ratio.den = 
in->sample_aspect_ratio.den;
 link->dst->inputs[0]->sample_aspect_ratio.num = 
in->sample_aspect_ratio.num;
-- 
2.11.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel