On Sat, Sep 24, 2016 at 01:58:09PM +0200, Luca Barbato wrote:
> --- a/libavcodec/nvenc.c
> +++ b/libavcodec/nvenc.c
> @@ -609,6 +609,53 @@ static void nvenc_setup_rate_control(AVCodecContext 
> *avctx)
>  
> +
> +    #if NVENCAPI_MAJOR_VERSION > 6
> +    if (ctx->aq) {

Please move the #if to the first column, as we do everywhere else.
I'd write ">= 7", but that's my personal taste.

> +        ctx->config.rcParams.enableAQ = 1;
> +        ctx->config.rcParams.aqStrength = ctx->aq_strength;

align

> +        av_log(avctx, AV_LOG_VERBOSE, "AQ Enabled\n");
> +        av_log(avctx, AV_LOG_VERBOSE, "Temporal AQ Enabled\n");
> +                   "Lookahead Not Enabled. Increase Buffer Delay 
> (-delay)\n");
> +                   "Lookahead Enabled: depth %d, Scenecut %s, B-Adapt %s\n",
> +        av_log(avctx, AV_LOG_VERBOSE, "Strict GOP Target Enabled\n");

English does not capitalize every word, let's respect that tradition.

> --- a/libavcodec/nvenc_h264.c
> +++ b/libavcodec/nvenc_h264.c
> @@ -77,6 +77,18 @@ static const AVOption options[] = {
> +    #if NVENCAPI_MAJOR_VERSION > 6
> +    { "rc-lookahead", "Number of frames to look ahead for rate-control", 
> OFFSET(rc_lookahead), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE },
> +    { "no-scenecut", "When lookahead is enabled, set this to 1 to disable 
> adaptive I-frame insertion at scene cuts", OFFSET(no_scenecut), 
> AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
> +    { "b_adapt", "When lookahead is enabled, set this to 0 to disable 
> adaptive B-frame decision", OFFSET(b_adapt), AV_OPT_TYPE_INT, { .i64 = 1 }, 
> 0, 1, VE },
> +    { "spatial-aq", "set to 1 to enable Spatial AQ", OFFSET(aq), 
> AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
> +    { "temporal-aq", "set to 1 to enable Temporal AQ",     
> OFFSET(temporal_aq),  AV_OPT_TYPE_INT,   { .i64 = 0                       }, 
> 0, 1, VE        },
> +    { "zerolatency", "Set 1 to indicate zero latency operation (no 
> reordering delay)", OFFSET(zerolatency), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, 
> VE },
> +    { "nonref_p", "Set this to 1 to enable automatic insertion of 
> non-reference P-frames", OFFSET(nonref_p), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 
> 1, VE },
> +    { "strict_gop", "Set 1 to minimize GOP-to-GOP rate fluctuations", 
> OFFSET(strict_gop), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
> +    { "aq-strength", "When Spatial AQ is enabled, this field is used to 
> specify AQ strength. AQ strength scale is from 1 (low) - 15 (aggressive)", 
> OFFSET(aq_strength), AV_OPT_TYPE_INT, { .i64 = 8 }, 1, 15, VE },
> +    { "cq", "Set target quality level (0 to 51, 0-automatic) for constant 
> quality mode in VBR rate control", OFFSET(quality), AV_OPT_TYPE_INT, { .i64 = 
> 0 }, 0, 51, VE },
> --- a/libavcodec/nvenc_hevc.c
> +++ b/libavcodec/nvenc_hevc.c
> @@ -77,6 +77,16 @@ static const AVOption options[] = {
> +    #if NVENCAPI_MAJOR_VERSION > 6
> +    { "rc-lookahead", "Number of frames to look ahead for rate-control", 
> OFFSET(rc_lookahead), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE },
> +    { "no-scenecut", "When lookahead is enabled, set this to 1 to disable 
> adaptive I-frame insertion at scene cuts", OFFSET(no_scenecut), 
> AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
> +    { "spatial_aq", "set to 1 to enable Spatial AQ", OFFSET(aq), 
> AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
> +    { "zerolatency", "Set 1 to indicate zero latency operation (no 
> reordering delay)", OFFSET(zerolatency), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, 
> VE },
> +    { "nonref_p", "Set this to 1 to enable automatic insertion of 
> non-reference P-frames", OFFSET(nonref_p), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 
> 1, VE },
> +    { "strict_gop", "Set 1 to minimize GOP-to-GOP rate fluctuations", 
> OFFSET(strict_gop), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
> +    { "aq-strength", "When Spatial AQ is enabled, this field is used to 
> specify AQ strength. AQ strength scale is from 1 (low) - 15 (aggressive)", 
> OFFSET(aq_strength), AV_OPT_TYPE_INT, { .i64 = 8 }, 1, 15, VE },
> +    { "cq", "Set target quality level (0 to 51, 0-automatic) for constant 
> quality mode in VBR rate control", OFFSET(quality), AV_OPT_TYPE_INT, { .i64 = 
> 0 }, 0, 51, VE },

"0: automatic" or "0 means automatic", same above.

Is there a reason none of the sentences in the descriptions end in a
period?

Patch itself LGTM.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to