Revision 6a5d4395 ffmpeg.c

View differences:

ffmpeg.c
109 109
static int video_mb_qmin = 2;
110 110
static int video_mb_qmax = 31;
111 111
static int video_qdiff = 3;
112
static int video_lelim = 0;
113
static int video_celim = 0;
112 114
static float video_qblur = 0.5;
115
static float video_qsquish = 0.0;
113 116
static float video_qcomp = 0.5;
114 117
static uint16_t *intra_matrix = NULL;
115 118
static uint16_t *inter_matrix = NULL;
......
162 165
static int use_qpel = 0;
163 166
static int use_qprd = 0;
164 167
static int use_cbprd = 0;
168
static int use_mv0 = 0;
169
static int do_normalize_aqp = 0;
165 170
static int qns = 0;
166 171
static int closed_gop = 0;
167 172
static int strict_gop = 0;
......
2442 2447
    }
2443 2448
}
2444 2449

  
2450
static void opt_qsquish(const char *arg)
2451
{
2452
    video_qsquish = atof(arg);
2453
    if (video_qsquish < 0.0 ||
2454
        video_qsquish > 99.0) {
2455
        fprintf(stderr, "qsquish must be >= 0.0 and <= 99.0\n");
2456
        exit(1);
2457
    }
2458
}
2459

  
2460
static void opt_lelim(const char *arg)
2461
{
2462
    video_lelim = atoi(arg);
2463
    if (video_lelim < -99 ||
2464
        video_lelim > 99) {
2465
        fprintf(stderr, "lelim must be >= -99 and <= 99\n");
2466
        exit(1);
2467
    }
2468
}
2469

  
2470
static void opt_celim(const char *arg)
2471
{
2472
    video_celim = atoi(arg);
2473
    if (video_celim < -99 ||
2474
        video_celim > 99) {
2475
        fprintf(stderr, "celim must be >= -99 and <= 99\n");
2476
        exit(1);
2477
    }
2478
}
2479

  
2445 2480
static void opt_lmax(const char *arg)
2446 2481
{
2447 2482
    video_lmax = atof(arg)*FF_QP2LAMBDA;
......
3146 3181
           	if (use_trell) {
3147 3182
                    video_enc->flags |= CODEC_FLAG_TRELLIS_QUANT;
3148 3183
                }
3184
                   if (use_mv0) {
3185
                    video_enc->flags |= CODEC_FLAG_MV0;
3186
                }
3187
                   if (do_normalize_aqp) {
3188
                    video_enc->flags |= CODEC_FLAG_NORMALIZE_AQP;
3189
                }
3149 3190
           	if (use_scan_offset) {
3150 3191
                    video_enc->flags |= CODEC_FLAG_SVCD_SCAN_OFFSET;
3151 3192
                }
......
3179 3220
                video_enc->qmax = video_qmax;
3180 3221
                video_enc->lmin = video_lmin;
3181 3222
                video_enc->lmax = video_lmax;
3223
                video_enc->rc_qsquish = video_qsquish;
3224
                video_enc->luma_elim_threshold = video_lelim;
3225
                video_enc->chroma_elim_threshold = video_celim;
3182 3226
                video_enc->mb_qmin = video_mb_qmin;
3183 3227
                video_enc->mb_qmax = video_mb_qmax;
3184 3228
                video_enc->max_qdiff = video_qdiff;
......
3903 3947
    { "mbqmax", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_mb_qmax}, "max macroblock quantiser scale (VBR)", "q" },
3904 3948
    { "qdiff", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_qdiff}, "max difference between the quantiser scale (VBR)", "q" },
3905 3949
    { "qblur", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_qblur}, "video quantiser scale blur (VBR)", "blur" },
3950
    { "qsquish", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_qsquish}, "how to keep quantiser between qmin and qmax (0 = clip, 1 = use differentiable function)", "squish" },
3906 3951
    { "qcomp", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_qcomp}, "video quantiser scale compression (VBR)", "compression" },
3907 3952
    { "rc_init_cplx", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_rc_initial_cplx}, "initial complexity for 1-pass encoding", "complexity" },
3908 3953
    { "b_qfactor", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_b_qfactor}, "qp factor between p and b frames", "factor" },
......
3936 3981
    { "cmp", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_cmp}, "fullpel compare function", "cmp function" },
3937 3982
    { "precmp", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_pre_cmp}, "pre motion estimation compare function", "cmp function" },
3938 3983
    { "preme", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_pre_me}, "pre motion estimation", "" },
3984
    { "lelim", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_lelim}, "single coefficient elimination threshold for luminance (negative values also consider DC coefficient)", "elim" },
3985
    { "celim", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_celim}, "single coefficient elimination threshold for chrominance (negative values also consider DC coefficient)", "elim" },
3939 3986
    { "lumi_mask", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_lumi_mask}, "luminance masking", "" },
3940 3987
    { "dark_mask", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_dark_mask}, "darkness masking", "" },
3941 3988
    { "scplx_mask", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_scplx_mask}, "spatial complexity masking", "" },
......
3970 4017
    { "qprd", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&use_qprd}, "" },
3971 4018
    { "cbp", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&use_cbprd}, "" },
3972 4019
    { "trell", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&use_trell}, "enable trellis quantization" },
4020
    { "mv0", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&use_mv0}, "try to encode each MB with MV=<0,0> and choose the better one (has no effect if mbd=0)" },
4021
    { "naq", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_normalize_aqp}, "normalize adaptive quantization" },
3973 4022
    { "cgop", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&closed_gop}, "closed gop" },
3974 4023
    { "sgop", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&strict_gop}, "strict gop" },
3975 4024
    { "scan_offset", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&use_scan_offset}, "enable SVCD Scan Offset placeholder" },

Also available in: Unified diff