[FFmpeg-devel] [PATCH v2 1/5] test/fate-run: duplicate pixfmts test when format is big-endian or native-endian

Michael Niedermayer michael at niedermayer.cc
Tue Jan 29 01:40:44 EET 2019


On Mon, Jan 28, 2019 at 05:07:37PM +0700, Muhammad Faiz wrote:
> When format is big-endian, also output little-endian checksum.
> This allows consistent checksum between little-endian and big-endian.
> 
> When format is native-endian (by passing parameter to pixfmts),
> output both little/big-endian. This allows invariant ouputs
> between little-endian and big-endian platform.
> 
> This reveals some bugs in libswscale (mismatched checksum
> between little-endian and big-endian on gbrap10, p010, and p016),
> and libavfilter (mismatched checksum between little-endian
> and big-endian on super2xsai filter).
> 
> Eventough this patch reveals bugs in libswscale, it does not
> mean to test libswscale. A complete separate solution to address
> it (e.g adding test to make sure that all lossless coversions
> are actually lossless) is beyond of this patch.
> 
> Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>
> ---
>  tests/fate-run.sh                        | 22 +++++++++-
>  tests/ref/fate/filter-pixfmts-copy       | 56 ++++++++++++++++++++++++
>  tests/ref/fate/filter-pixfmts-crop       | 56 ++++++++++++++++++++++++
>  tests/ref/fate/filter-pixfmts-field      | 56 ++++++++++++++++++++++++
>  tests/ref/fate/filter-pixfmts-fieldorder | 44 +++++++++++++++++++
>  tests/ref/fate/filter-pixfmts-hflip      | 56 ++++++++++++++++++++++++
>  tests/ref/fate/filter-pixfmts-il         | 56 ++++++++++++++++++++++++
>  tests/ref/fate/filter-pixfmts-null       | 56 ++++++++++++++++++++++++
>  tests/ref/fate/filter-pixfmts-scale      | 56 ++++++++++++++++++++++++
>  tests/ref/fate/filter-pixfmts-super2xsai |  4 ++
>  tests/ref/fate/filter-pixfmts-swapuv     | 28 ++++++++++++
>  tests/ref/fate/filter-pixfmts-transpose  | 45 +++++++++++++++++++
>  tests/ref/fate/filter-pixfmts-vflip      | 56 ++++++++++++++++++++++++
>  13 files changed, 589 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/fate-run.sh b/tests/fate-run.sh
> index aece90a01d..dc4619e59c 100755
> --- a/tests/fate-run.sh
> +++ b/tests/fate-run.sh
> @@ -280,6 +280,7 @@ pixfmts(){
>      filter_args=$1
>      prefilter_chain=$2
>      nframes=${3:-1}
> +    native_endian=$4
>  
>      showfiltfmts="$target_exec $target_path/libavfilter/tests/filtfmts"
>      scale_exclude_fmts=${outfile}_scale_exclude_fmts
> @@ -297,8 +298,25 @@ pixfmts(){
>  
>      outertest=$test
>      for pix_fmt in $pix_fmts; do
> -        test=$pix_fmt
> -        video_filter "${prefilter_chain}format=$pix_fmt,$filter=$filter_args" -pix_fmt $pix_fmt -frames:v $nframes
> +        pix_fmt_le=`echo $pix_fmt | sed 's/be$/le/'`
> +        pix_fmt_be=`echo $pix_fmt | sed 's/le$/be/'`
> +        if test "$pix_fmt_le" = "$pix_fmt_be"; then
> +            test=$pix_fmt
> +            video_filter "${prefilter_chain}format=$pix_fmt,$filter=$filter_args" -pix_fmt $pix_fmt -frames:v $nframes
> +        elif test -n "$native_endian"; then
> +            pix_fmt_ne=`echo $pix_fmt_le | sed 's/le$//'`
> +            test="$pix_fmt_ne(be)"
> +            video_filter "${prefilter_chain}format=$pix_fmt,$filter=$filter_args,format=$pix_fmt" -pix_fmt $pix_fmt_be -frames:v $nframes
> +            test="$pix_fmt_ne(le)"
> +            video_filter "${prefilter_chain}format=$pix_fmt,$filter=$filter_args,format=$pix_fmt" -pix_fmt $pix_fmt_le -frames:v $nframes
> +        else
> +            test=$pix_fmt
> +            video_filter "${prefilter_chain}format=$pix_fmt,$filter=$filter_args" -pix_fmt $pix_fmt -frames:v $nframes
> +            if test "$pix_fmt_be" = "$pix_fmt"; then
> +                test="$pix_fmt(le)"
> +                video_filter "${prefilter_chain}format=$pix_fmt,$filter=$filter_args,format=$pix_fmt" -pix_fmt $pix_fmt_le -frames:v $nframes
> +            fi
> +        fi
>      done

looks better

thanks!

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

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190129/a68b4dcd/attachment.sig>


More information about the ffmpeg-devel mailing list