Re: [FFmpeg-devel] [PATCH 01/23] avcodec: add color_range to AVCodec struct and use it

2017-12-12 Thread Michael Niedermayer
On Tue, Dec 12, 2017 at 02:55:59PM +0100, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavcodec/avcodec.h | 1 +
>  libavcodec/utils.c   | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 5db6a81320..df715fd5ee 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -3376,6 +3376,7 @@ typedef struct AVCodec {
>  uint8_t max_lowres; ///< maximum value for lowres 
> supported by the decoder
>  const AVClass *priv_class;  ///< AVClass for the private 
> context
>  const AVProfile *profiles;  ///< array of recognized 
> profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
> +const enum AVColorRange *color_ranges;  ///< array of supported color 
> ranges by encoder, or  NULL if unknown, array is terminated by -1
>  
>  /*
>   * No fields below this line are part of the public API. They
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 873f39f9bd..41cc6fbf2c 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -879,6 +879,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ444P)
>  avctx->color_range = AVCOL_RANGE_JPEG;
>  }
> +if (avctx->codec->color_range)
> +avctx->color_range = avctx->codec->color_range;

This doesnt build, i can thus not easily bisect some fate failure:

libavcodec/utils.c: In function ‘avcodec_open2’:
libavcodec/utils.c:882:25: error: ‘const struct AVCodec’ has no member named 
‘color_range’
 if (avctx->codec->color_range)
 ^
libavcodec/utils.c:883:46: error: ‘const struct AVCodec’ has no member named 
‘color_range’
 avctx->color_range = avctx->codec->color_range;


[...]

 #dimensions 0: 128x128
-#sar 0: 72/72
+#sar 0: 1/1
 0,  0,  0,1,49152, 0xe0013dee
Test png-rgb24 failed. Look at tests/data/fate/png-rgb24.err for details.
make: *** [fate-png-rgb24] Error 1
TESTpsd-rgba
TESTpsd-rgba64
TESTpsd-ya8
TESTpsd-ya16
--- ./tests/ref/fate/png-int-rgb24  2017-12-13 00:39:32.256314963 +0100
--
 #dimensions 0: 128x128
-#sar 0: 2835/2835
+#sar 0: 1/1
 0,  0,  0,1,49152, 0xe0013dee
Test png-int-rgb24 failed. Look at tests/data/fate/png-int-rgb24.err for 
details.
make: *** [fate-png-int-rgb24] Error 1
TESTpsd-lena-127x127-rgb24
TESTpsd-lena-rgb-rle-127x127-16b
TESTpsd-lena-rgb-rle-127x127-8b
TESTpsd-lena-rgba-rle-128x128-8b
TESTpsd-lena-256c
--
 0,  0,  0,1, 1600, 0x01a481a9
 0,  1,  1,1, 1600, 0x01a481a9
 0,  2,  2,1, 1600, 0x01a481a9
TESTlossless-alac
Test pngparser failed. Look at tests/data/fate/pngparser.err for details.
make: *** [fate-pngparser] Error 1
TESTlossless-meridianaudio
TESTralf
TESTlossless-shorten
TESTlossless-tak
TESTlossless-truehd-5.1


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.


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


Re: [FFmpeg-devel] [PATCH 01/23] avcodec: add color_range to AVCodec struct and use it

2017-12-12 Thread wm4
On Tue, 12 Dec 2017 14:55:59 +0100
Paul B Mahol  wrote:

> Signed-off-by: Paul B Mahol 
> ---
>  libavcodec/avcodec.h | 1 +
>  libavcodec/utils.c   | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 5db6a81320..df715fd5ee 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -3376,6 +3376,7 @@ typedef struct AVCodec {
>  uint8_t max_lowres; ///< maximum value for lowres 
> supported by the decoder
>  const AVClass *priv_class;  ///< AVClass for the private 
> context
>  const AVProfile *profiles;  ///< array of recognized 
> profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
> +const enum AVColorRange *color_ranges;  ///< array of supported color 
> ranges by encoder, or  NULL if unknown, array is terminated by -1

wouldn't it be terminated by AVCOL_RANGE_UNSPECIFIED? (The enum might be
backed by an unsigned integer type, so this is not just bikeshed.)

>  
>  /*
>   * No fields below this line are part of the public API. They
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 873f39f9bd..41cc6fbf2c 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -879,6 +879,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ444P)
>  avctx->color_range = AVCOL_RANGE_JPEG;
>  }
> +if (avctx->codec->color_range)
> +avctx->color_range = avctx->codec->color_range;
>  if (avctx->codec->supported_samplerates) {
>  for (i = 0; avctx->codec->supported_samplerates[i] != 0; i++)
>  if (avctx->sample_rate == 
> avctx->codec->supported_samplerates[i])

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