1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

ffv1enc_vulkan: support default range coder tables

This adds support for default range coder tables, rather than
only custom ones. Its two lines, as the same code can be used
for both thanks to ffv1enc.c setting f->state_transition properly.
This commit is contained in:
Lynne
2025-01-19 14:55:24 +09:00
parent 5cf4f145ad
commit 542a567d50

View File

@ -1581,7 +1581,7 @@ static av_cold int vulkan_encode_ffv1_init(AVCodecContext *avctx)
if (f->version < 4) { if (f->version < 4) {
av_log(avctx, AV_LOG_ERROR, "PCM coding only supported by version 4 (-level 4)\n"); av_log(avctx, AV_LOG_ERROR, "PCM coding only supported by version 4 (-level 4)\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} else if (f->ac != AC_RANGE_CUSTOM_TAB) { } else if (f->ac == AC_GOLOMB_RICE) {
av_log(avctx, AV_LOG_ERROR, "PCM coding requires range coding\n"); av_log(avctx, AV_LOG_ERROR, "PCM coding requires range coding\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
@ -1798,6 +1798,8 @@ static const AVOption vulkan_encode_ffv1_options[] = {
{ .i64 = AC_RANGE_CUSTOM_TAB }, -2, 2, VE, .unit = "coder" }, { .i64 = AC_RANGE_CUSTOM_TAB }, -2, 2, VE, .unit = "coder" },
{ "rice", "Golomb rice", 0, AV_OPT_TYPE_CONST, { "rice", "Golomb rice", 0, AV_OPT_TYPE_CONST,
{ .i64 = AC_GOLOMB_RICE }, INT_MIN, INT_MAX, VE, .unit = "coder" }, { .i64 = AC_GOLOMB_RICE }, INT_MIN, INT_MAX, VE, .unit = "coder" },
{ "range_def", "Range with default table", 0, AV_OPT_TYPE_CONST,
{ .i64 = AC_RANGE_DEFAULT_TAB_FORCE }, INT_MIN, INT_MAX, VE, .unit = "coder" },
{ "range_tab", "Range with custom table", 0, AV_OPT_TYPE_CONST, { "range_tab", "Range with custom table", 0, AV_OPT_TYPE_CONST,
{ .i64 = AC_RANGE_CUSTOM_TAB }, INT_MIN, INT_MAX, VE, .unit = "coder" }, { .i64 = AC_RANGE_CUSTOM_TAB }, INT_MIN, INT_MAX, VE, .unit = "coder" },
{ "qtable", "Quantization table", OFFSET(ctx.qtable), AV_OPT_TYPE_INT, { "qtable", "Quantization table", OFFSET(ctx.qtable), AV_OPT_TYPE_INT,