|
|
@ -74,6 +74,7 @@ typedef struct VP8EncoderContext { |
|
|
|
int lag_in_frames; |
|
|
|
int lag_in_frames; |
|
|
|
int error_resilient; |
|
|
|
int error_resilient; |
|
|
|
int crf; |
|
|
|
int crf; |
|
|
|
|
|
|
|
int max_intra_rate; |
|
|
|
} VP8Context; |
|
|
|
} VP8Context; |
|
|
|
|
|
|
|
|
|
|
|
/** String mappings for enum vp8e_enc_control_id */ |
|
|
|
/** String mappings for enum vp8e_enc_control_id */ |
|
|
@ -95,6 +96,7 @@ static const char *const ctlidstr[] = { |
|
|
|
[VP8E_SET_ARNR_STRENGTH] = "VP8E_SET_ARNR_STRENGTH", |
|
|
|
[VP8E_SET_ARNR_STRENGTH] = "VP8E_SET_ARNR_STRENGTH", |
|
|
|
[VP8E_SET_ARNR_TYPE] = "VP8E_SET_ARNR_TYPE", |
|
|
|
[VP8E_SET_ARNR_TYPE] = "VP8E_SET_ARNR_TYPE", |
|
|
|
[VP8E_SET_CQ_LEVEL] = "VP8E_SET_CQ_LEVEL", |
|
|
|
[VP8E_SET_CQ_LEVEL] = "VP8E_SET_CQ_LEVEL", |
|
|
|
|
|
|
|
[VP8E_SET_MAX_INTRA_BITRATE_PCT] = "VP8E_SET_MAX_INTRA_BITRATE_PCT", |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc) |
|
|
|
static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc) |
|
|
@ -353,6 +355,8 @@ static av_cold int vp8_init(AVCodecContext *avctx) |
|
|
|
codecctl_int(avctx, VP8E_SET_TOKEN_PARTITIONS, av_log2(avctx->slices)); |
|
|
|
codecctl_int(avctx, VP8E_SET_TOKEN_PARTITIONS, av_log2(avctx->slices)); |
|
|
|
codecctl_int(avctx, VP8E_SET_STATIC_THRESHOLD, avctx->mb_threshold); |
|
|
|
codecctl_int(avctx, VP8E_SET_STATIC_THRESHOLD, avctx->mb_threshold); |
|
|
|
codecctl_int(avctx, VP8E_SET_CQ_LEVEL, ctx->crf); |
|
|
|
codecctl_int(avctx, VP8E_SET_CQ_LEVEL, ctx->crf); |
|
|
|
|
|
|
|
if (ctx->max_intra_rate >= 0) |
|
|
|
|
|
|
|
codecctl_int(avctx, VP8E_SET_MAX_INTRA_BITRATE_PCT, ctx->max_intra_rate); |
|
|
|
|
|
|
|
|
|
|
|
av_log(avctx, AV_LOG_DEBUG, "Using deadline: %d\n", ctx->deadline); |
|
|
|
av_log(avctx, AV_LOG_DEBUG, "Using deadline: %d\n", ctx->deadline); |
|
|
|
|
|
|
|
|
|
|
@ -556,6 +560,7 @@ static const AVOption options[] = { |
|
|
|
{ "good", NULL, 0, AV_OPT_TYPE_CONST, {VPX_DL_GOOD_QUALITY}, 0, 0, VE, "quality"}, |
|
|
|
{ "good", NULL, 0, AV_OPT_TYPE_CONST, {VPX_DL_GOOD_QUALITY}, 0, 0, VE, "quality"}, |
|
|
|
{ "realtime", NULL, 0, AV_OPT_TYPE_CONST, {VPX_DL_REALTIME}, 0, 0, VE, "quality"}, |
|
|
|
{ "realtime", NULL, 0, AV_OPT_TYPE_CONST, {VPX_DL_REALTIME}, 0, 0, VE, "quality"}, |
|
|
|
{ "error-resilient", "Error resilience configuration", OFFSET(error_resilient), AV_OPT_TYPE_FLAGS, {0}, INT_MIN, INT_MAX, VE, "er"}, |
|
|
|
{ "error-resilient", "Error resilience configuration", OFFSET(error_resilient), AV_OPT_TYPE_FLAGS, {0}, INT_MIN, INT_MAX, VE, "er"}, |
|
|
|
|
|
|
|
{ "max-intra-rate", "Maximum I-frame bitrate (pct) 0=unlimited", OFFSET(max_intra_rate), AV_OPT_TYPE_INT, {-1}, -1, INT_MAX, VE}, |
|
|
|
#ifdef VPX_ERROR_RESILIENT_DEFAULT |
|
|
|
#ifdef VPX_ERROR_RESILIENT_DEFAULT |
|
|
|
{ "default", "Improve resiliency against losses of whole frames", 0, AV_OPT_TYPE_CONST, {VPX_ERROR_RESILIENT_DEFAULT}, 0, 0, VE, "er"}, |
|
|
|
{ "default", "Improve resiliency against losses of whole frames", 0, AV_OPT_TYPE_CONST, {VPX_ERROR_RESILIENT_DEFAULT}, 0, 0, VE, "er"}, |
|
|
|
{ "partitions", "The frame partitions are independently decodable " |
|
|
|
{ "partitions", "The frame partitions are independently decodable " |
|
|
|