Re: [FFmpeg-devel] [PATCH] libavcodec/x265: detect csps in libx265_encode_init_csp()

2015-05-17 Thread Derek Buitenhuis
On 5/16/2015 4:05 AM, Steve Borho wrote:
> Without this change, if you link with an 8bit libx265 and try to specify
> a 10bit input color space via:
> 
>   ffmpeg -i in.mov -c:v libx265 -pix_fmt yuv420p10le out.mp4
> 
> It will error with:

nit: It's not an error, it just changes the filter chain.

> 
>   Incompatible pixel format 'yuv420p10le' for codec 'libx265',
>   auto-selecting format 'yuv420p'
> 
> With this fix, it will learn if a 10bit libx265 is available at startup,
> and thus allow 10bit input color spaces.
> ---
>  libavcodec/libx265.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

As discussed on IRC, I think it is OK.

- Derek

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


[FFmpeg-devel] [PATCH] libavcodec/x265: detect csps in libx265_encode_init_csp()

2015-05-17 Thread Steve Borho
Without this change, if you link with an 8bit libx265 and try to specify
a 10bit input color space via:

  ffmpeg -i in.mov -c:v libx265 -pix_fmt yuv420p10le out.mp4

It will error with:

  Incompatible pixel format 'yuv420p10le' for codec 'libx265',
  auto-selecting format 'yuv420p'

With this fix, it will learn if a 10bit libx265 is available at startup,
and thus allow 10bit input color spaces.
---
 libavcodec/libx265.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 7423e13..e9240f9 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -342,10 +342,10 @@ static const enum AVPixelFormat x265_csp_twelve[] = {
 
 static av_cold void libx265_encode_init_csp(AVCodec *codec)
 {
-if (x265_max_bit_depth == 8)
-codec->pix_fmts = x265_csp_eight;
-else if (x265_max_bit_depth == 12)
+if (x265_api_get(10))
 codec->pix_fmts = x265_csp_twelve;
+else if (x265_api_get(8))
+codec->pix_fmts = x265_csp_eight;
 }
 
 #define OFFSET(x) offsetof(libx265Context, x)
-- 
2.1.4

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