[FFmpeg-devel] [PATCH 4/6] avfilter/vf_pixdesctest: also take into account undefined alpha components

Michael Niedermayer michael at niedermayer.cc
Mon Oct 21 02:53:19 EEST 2024


On Fri, Oct 18, 2024 at 11:34:46PM -0300, James Almer wrote:
> Ensure those bits are copied, which will result in the output being the same as
> the input, where swscale set them to the equivalent of fully opaque.
> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavfilter/vf_pixdesctest.c            | 2 +-
>  tests/ref/fate/filter-pixdesc-0bgr      | 2 +-
>  tests/ref/fate/filter-pixdesc-0rgb      | 2 +-
>  tests/ref/fate/filter-pixdesc-bgr0      | 2 +-
>  tests/ref/fate/filter-pixdesc-rgb0      | 2 +-
>  tests/ref/fate/filter-pixdesc-v30xle    | 2 +-
>  tests/ref/fate/filter-pixdesc-vuyx      | 2 +-
>  tests/ref/fate/filter-pixdesc-x2bgr10le | 2 +-
>  tests/ref/fate/filter-pixdesc-x2rgb10le | 2 +-
>  tests/ref/fate/filter-pixdesc-xv30le    | 2 +-
>  tests/ref/fate/filter-pixdesc-xv36be    | 2 +-
>  tests/ref/fate/filter-pixdesc-xv36le    | 2 +-
>  12 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/libavfilter/vf_pixdesctest.c b/libavfilter/vf_pixdesctest.c
> index f53f087f21..5e418238b0 100644
> --- a/libavfilter/vf_pixdesctest.c
> +++ b/libavfilter/vf_pixdesctest.c
> @@ -84,7 +84,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
>      if (priv->pix_desc->flags & AV_PIX_FMT_FLAG_PAL)
>          memcpy(out->data[1], in->data[1], AVPALETTE_SIZE);
>  
> -    for (c = 0; c < priv->pix_desc->nb_components; c++) {
> +    for (c = 0; c < FF_ARRAY_ELEMS(priv->pix_desc->comp); c++) {
>          const int w1 = c == 1 || c == 2 ? cw : w;
>          const int h1 = c == 1 || c == 2 ? ch : h;

probably ok

thx

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

"You are 36 times more likely to die in a bathtub than at the hands of a
terrorist. Also, you are 2.5 times more likely to become a president and
2 times more likely to become an astronaut, than to die in a terrorist
attack." -- Thoughty2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241021/c1b71c99/attachment.sig>


More information about the ffmpeg-devel mailing list