Re: [libav-devel] [PATCH 4/7] x264: Use the framerate information instead of the timebase

2018-02-18 Thread Luca Barbato

On 17/02/2018 04:53, Vittorio Giovara wrote:

On Fri, Feb 16, 2018 at 12:02 PM, Luca Barbato  wrote:


Unbreaks the rate-control behaviour.



Same comment as for the x265 patch.
This seems to properly use x264 API.



Locally amended with:

The API expects an average framerate and a timebase, the
timebase is often 1/1000 while the reported average framerate
is 30. Use the correct information to avoid surprising results.

lu



___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 4/7] x264: Use the framerate information instead of the timebase

2018-02-16 Thread Vittorio Giovara
On Fri, Feb 16, 2018 at 12:02 PM, Luca Barbato  wrote:

> Unbreaks the rate-control behaviour.
>

Same comment as for the x265 patch.
This seems to properly use x264 API.

---
>  libavcodec/libx264.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
> index 3dc53aaf38..b3f91a1f07 100644
> --- a/libavcodec/libx264.c
> +++ b/libavcodec/libx264.c
> @@ -573,8 +573,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  x4->params.i_height = avctx->height;
>  x4->params.vui.i_sar_width  = avctx->sample_aspect_ratio.num;
>  x4->params.vui.i_sar_height = avctx->sample_aspect_ratio.den;
> -x4->params.i_fps_num = x4->params.i_timebase_den =
> avctx->time_base.den;
> -x4->params.i_fps_den = x4->params.i_timebase_num =
> avctx->time_base.num;
> +
> +x4->params.i_fps_num = avctx->framerate.num;
> +x4->params.i_fps_den = avctx->framerate.den;
> +
> +x4->params.i_timebase_num = avctx->time_base.num;
> +x4->params.i_timebase_den = avctx->time_base.den;
>
>  x4->params.analyse.b_psnr = avctx->flags & AV_CODEC_FLAG_PSNR;
>
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH 4/7] x264: Use the framerate information instead of the timebase

2018-02-16 Thread Luca Barbato
Unbreaks the rate-control behaviour.
---
 libavcodec/libx264.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 3dc53aaf38..b3f91a1f07 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -573,8 +573,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
 x4->params.i_height = avctx->height;
 x4->params.vui.i_sar_width  = avctx->sample_aspect_ratio.num;
 x4->params.vui.i_sar_height = avctx->sample_aspect_ratio.den;
-x4->params.i_fps_num = x4->params.i_timebase_den = avctx->time_base.den;
-x4->params.i_fps_den = x4->params.i_timebase_num = avctx->time_base.num;
+
+x4->params.i_fps_num = avctx->framerate.num;
+x4->params.i_fps_den = avctx->framerate.den;
+
+x4->params.i_timebase_num = avctx->time_base.num;
+x4->params.i_timebase_den = avctx->time_base.den;
 
 x4->params.analyse.b_psnr = avctx->flags & AV_CODEC_FLAG_PSNR;
 
-- 
2.12.2

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel