Revision 8eeed0db

View differences:

configure
2910 2910
enabled libvpx     && {
2911 2911
    enabled libvpx_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
2912 2912
                                die "ERROR: libvpx decoder version must be >=0.9.1"; }
2913
    enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_enc_init_ver -lvpx ||
2914
                                die "ERROR: libvpx encoder version must be >=0.9.1"; } }
2913
    enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VPX_CQ" -lvpx ||
2914
                                die "ERROR: libvpx encoder version must be >=0.9.6"; } }
2915 2915
enabled libx264    && require  libx264 x264.h x264_encoder_encode -lx264 &&
2916 2916
                      { check_cpp_condition x264.h "X264_BUILD >= 99" ||
2917 2917
                        die "ERROR: libx264 version must be >= 0.99."; }
libavcodec/libvpxenc.c
72 72
    [VP8E_SET_ARNR_MAXFRAMES]    = "VP8E_SET_ARNR_MAXFRAMES",
73 73
    [VP8E_SET_ARNR_STRENGTH]     = "VP8E_SET_ARNR_STRENGTH",
74 74
    [VP8E_SET_ARNR_TYPE]         = "VP8E_SET_ARNR_TYPE",
75
    [VP8E_SET_CQ_LEVEL]          = "VP8E_SET_CQ_LEVEL",
75 76
};
76 77

  
77 78
static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc)
......
234 235
    if (avctx->rc_min_rate == avctx->rc_max_rate &&
235 236
        avctx->rc_min_rate == avctx->bit_rate)
236 237
        enccfg.rc_end_usage = VPX_CBR;
238
    else if (avctx->crf)
239
        enccfg.rc_end_usage = VPX_CQ;
237 240
    enccfg.rc_target_bitrate = av_rescale_rnd(avctx->bit_rate, 1, 1000,
238 241
                                              AV_ROUND_NEAR_INF);
239 242

  
......
312 315
    codecctl_int(avctx, VP8E_SET_NOISE_SENSITIVITY, avctx->noise_reduction);
313 316
    codecctl_int(avctx, VP8E_SET_TOKEN_PARTITIONS,  av_log2(avctx->slices));
314 317
    codecctl_int(avctx, VP8E_SET_STATIC_THRESHOLD,  avctx->mb_threshold);
318
    codecctl_int(avctx, VP8E_SET_CQ_LEVEL,          (int)avctx->crf);
315 319

  
316 320
    //provide dummy value to initialize wrapper, values will be updated each _encode()
317 321
    vpx_img_wrap(&ctx->rawimg, VPX_IMG_FMT_I420, avctx->width, avctx->height, 1,
libavcodec/options.c
367 367
{"all"             , NULL, 0, FF_OPT_TYPE_CONST, AVDISCARD_ALL    , INT_MIN, INT_MAX, V|D, "avdiscard"},
368 368
{"bidir_refine", "refine the two motion vectors used in bidirectional macroblocks", OFFSET(bidir_refine), FF_OPT_TYPE_INT, 1, 0, 4, V|E},
369 369
{"brd_scale", "downscales frames for dynamic B-frame decision", OFFSET(brd_scale), FF_OPT_TYPE_INT, DEFAULT, 0, 10, V|E},
370
{"crf", "enables constant quality mode, and selects the quality (x264)", OFFSET(crf), FF_OPT_TYPE_FLOAT, DEFAULT, 0, 51, V|E},
370
{"crf", "enables constant quality mode, and selects the quality (x264/VP8)", OFFSET(crf), FF_OPT_TYPE_FLOAT, DEFAULT, 0, 63, V|E},
371 371
{"cqp", "constant quantization parameter rate control method", OFFSET(cqp), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, V|E},
372 372
{"keyint_min", "minimum interval between IDR-frames (x264)", OFFSET(keyint_min), FF_OPT_TYPE_INT, 25, INT_MIN, INT_MAX, V|E},
373 373
{"refs", "reference frames to consider for motion compensation (Snow)", OFFSET(refs), FF_OPT_TYPE_INT, 1, INT_MIN, INT_MAX, V|E},

Also available in: Unified diff