diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-04-08 14:59:53 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-04-09 17:21:35 +0200 |
commit | bbaf941e29dcc1209dc0b0545bb0c31c86bd73b8 (patch) | |
tree | a7c4f5d28252847f817415714aa0229c8768649f /libavfilter/vf_scale.c | |
parent | 438f3ef8214ddc3bc3f2c25328c34065df48d4e6 (diff) | |
download | ffmpeg-bbaf941e29dcc1209dc0b0545bb0c31c86bd73b8.tar.gz |
scale: fix slice rendering with conversion between pal/non-pal.
We can't use whether the input format is paletted to decide that
the output format has a palette in data[1], too, that makes no sense.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavfilter/vf_scale.c')
-rw-r--r-- | libavfilter/vf_scale.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index deb7009fa1..00f2ed1ee4 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -72,6 +72,7 @@ typedef struct { int hsub, vsub; ///< chroma subsampling int slice_y; ///< top of current output slice int input_is_pal; ///< set to 1 if the input format is paletted + int output_is_pal; ///< set to 1 if the output format is paletted int interlaced; char w_expr[256]; ///< width expression string @@ -211,6 +212,8 @@ static int config_props(AVFilterLink *outlink) scale->input_is_pal = av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL || av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PSEUDOPAL; if (outfmt == PIX_FMT_PAL8) outfmt = PIX_FMT_BGR8; + scale->output_is_pal = av_pix_fmt_descriptors[outfmt].flags & PIX_FMT_PAL || + av_pix_fmt_descriptors[outfmt].flags & PIX_FMT_PSEUDOPAL; if (scale->sws) sws_freeContext(scale->sws); @@ -303,10 +306,10 @@ static int scale_slice(AVFilterLink *link, struct SwsContext *sws, int y, int h, in[i] = cur_pic->data[i] + ((y>>vsub)+field) * cur_pic->linesize[i]; out[i] = out_buf->data[i] + field * out_buf->linesize[i]; } - if(scale->input_is_pal){ + if(scale->input_is_pal) in[1] = cur_pic->data[1]; + if(scale->output_is_pal) out[1] = out_buf->data[1]; - } return sws_scale(sws, in, in_stride, y/mul, h, out,out_stride); |