History

avcodec/mlpenc: export lpc_coeff_precision option

Change default precision from 11 to 15, improves compression.

Paul B Mahol committed 3 years ago

Commit 44dc42e1 parent 33f058f1 file · +5 −3Browse files

Unified · Split

libavcodec/mlpenc.c+5−3
@@ -127,6 +127,7 @@ typedef struct MLPEncodeContext { · 126 unmodified lines
127127
128128 int max_restart_interval; ///< Max interval of access units in between two major frames.
129129 int min_restart_interval; ///< Min interval of access units in between two major frames.
130+ int lpc_coeff_precision;
130131 int lpc_type;
131132 int lpc_passes;
132133 int prediction_order;
@@ -243,7 +244,7 @@ static int compare_filter_params(const ChannelParams *prev_cp, const ChannelPara · 110 unmodified lines
243244 if (prev->order != fp->order)
244245 return 1;
245246
246− if (!prev->order)
247+ if (!fp->order)
247248 return 0;
248249
249250 if (prev->shift != fp->shift)
@@ -266,7 +267,7 @@ static int compare_matrix_params(MLPEncodeContext *ctx, const MatrixParams *prev · 16 unmodified lines
266267 if (prev->count != mp->count)
267268 return 1;
268269
269− if (!prev->count)
270+ if (!mp->count)
270271 return 0;
271272
272273 for (unsigned int channel = rh->min_channel; channel <= rh->max_channel; channel++)
@@ -1293,7 +1294,7 @@ static void set_filter_params(MLPEncodeContext *ctx, · 1020 unmodified lines
12931294
12941295 order = ff_lpc_calc_coefs(&ctx->lpc_ctx, ctx->lpc_sample_buffer,
12951296 ctx->number_of_samples, MLP_MIN_LPC_ORDER,
1296− max_order, 11, coefs, shift, ctx->lpc_type, ctx->lpc_passes,
1297+ max_order, ctx->lpc_coeff_precision, coefs, shift, ctx->lpc_type, ctx->lpc_passes,
12971298 ctx->prediction_order, MLP_MIN_LPC_SHIFT,
12981299 MLP_MAX_LPC_SHIFT, MLP_MIN_LPC_SHIFT);
12991300
@@ -2160,6 +2161,7 @@ static av_cold int mlp_encode_close(AVCodecContext *avctx) · 860 unmodified lines
21602161 #define OFFSET(x) offsetof(MLPEncodeContext, x)
21612162 static const AVOption mlp_options[] = {
21622163 { "max_interval", "Max number of frames between each new header", OFFSET(max_restart_interval), AV_OPT_TYPE_INT, {.i64 = 16 }, MIN_HEADER_INTERVAL, MAX_HEADER_INTERVAL, FLAGS },
2164+{ "lpc_coeff_precision", "LPC coefficient precision", OFFSET(lpc_coeff_precision), AV_OPT_TYPE_INT, {.i64 = 15 }, 0, 15, FLAGS },
21632165 { "lpc_type", "LPC algorithm", OFFSET(lpc_type), AV_OPT_TYPE_INT, {.i64 = FF_LPC_TYPE_LEVINSON }, FF_LPC_TYPE_LEVINSON, FF_LPC_TYPE_CHOLESKY, FLAGS, "lpc_type" },
21642166 { "levinson", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_LEVINSON }, 0, 0, FLAGS, "lpc_type" },
21652167 { "cholesky", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_CHOLESKY }, 0, 0, FLAGS, "lpc_type" },

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t