[FFmpeg-devel,v2,2/3] lavc/libxavs2: use upper layer qp parameters first

Submitted by hwren on Jan. 24, 2019, 3:16 p.m.

Details

Message ID 1548342978-4887-2-git-send-email-hwrenx@126.com
State Accepted
Commit 11751f62520b0b5a575abb5a8ce061a727eb2668
Headers show

Commit Message

hwren Jan. 24, 2019, 3:16 p.m.
Signed-off-by: hwrenx <hwrenx@126.com>
---
 libavcodec/libxavs2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Steven Liu Jan. 25, 2019, 7:14 a.m.
> 在 2019年1月24日,下午11:16,hwrenx <hwrenx@126.com> 写道:
> 
> Signed-off-by: hwrenx <hwrenx@126.com>
> ---
> libavcodec/libxavs2.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c
> index 2d29427..d5c4557 100644
> --- a/libavcodec/libxavs2.c
> +++ b/libavcodec/libxavs2.c
> @@ -109,8 +109,8 @@ static av_cold int xavs2_init(AVCodecContext *avctx)
>         xavs2_opt_set2("RateControl",   "%d", 1);
>         xavs2_opt_set2("TargetBitRate", "%"PRId64"", avctx->bit_rate);
>         xavs2_opt_set2("InitialQP",     "%d", cae->initial_qp);
> -        xavs2_opt_set2("MaxQP",         "%d", cae->max_qp);
> -        xavs2_opt_set2("MinQP",         "%d", cae->min_qp);
> +        xavs2_opt_set2("MaxQP",         "%d", avctx->qmax >= 0 ? avctx->qmax : cae->max_qp);
> +        xavs2_opt_set2("MinQP",         "%d", avctx->qmin >= 0 ? avctx->qmin : cae->min_qp);
>     } else {
>         xavs2_opt_set2("InitialQP",     "%d", cae->qp);
>     }
> -- 
> 2.7.4
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

patchset LGTM too


Thanks

Patch hide | download patch | download mbox

diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c
index 2d29427..d5c4557 100644
--- a/libavcodec/libxavs2.c
+++ b/libavcodec/libxavs2.c
@@ -109,8 +109,8 @@  static av_cold int xavs2_init(AVCodecContext *avctx)
         xavs2_opt_set2("RateControl",   "%d", 1);
         xavs2_opt_set2("TargetBitRate", "%"PRId64"", avctx->bit_rate);
         xavs2_opt_set2("InitialQP",     "%d", cae->initial_qp);
-        xavs2_opt_set2("MaxQP",         "%d", cae->max_qp);
-        xavs2_opt_set2("MinQP",         "%d", cae->min_qp);
+        xavs2_opt_set2("MaxQP",         "%d", avctx->qmax >= 0 ? avctx->qmax : cae->max_qp);
+        xavs2_opt_set2("MinQP",         "%d", avctx->qmin >= 0 ? avctx->qmin : cae->min_qp);
     } else {
         xavs2_opt_set2("InitialQP",     "%d", cae->qp);
     }