Revision 8eeed0db libavcodec/libvpxenc.c

View differences:

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,

Also available in: Unified diff