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
127 127
128 int max_restart_interval; ///< Max interval of access units in between two major frames.128 int max_restart_interval; ///< Max interval of access units in between two major frames.
129 int min_restart_interval; ///< Min interval of access units in between two major frames.129 int min_restart_interval; ///< Min interval of access units in between two major frames.
130 int lpc_coeff_precision;
130 int lpc_type;131 int lpc_type;
131 int lpc_passes;132 int lpc_passes;
132 int prediction_order;133 int prediction_order;
@@ -243,7 +244,7 @@ static int compare_filter_params(const ChannelParams *prev_cp, const ChannelPara · 110 unmodified lines
243 if (prev->order != fp->order)244 if (prev->order != fp->order)
244 return 1;245 return 1;
245 246
246 if (!prev->order)247 if (!fp->order)
247 return 0;248 return 0;
248 249
249 if (prev->shift != fp->shift)250 if (prev->shift != fp->shift)
@@ -266,7 +267,7 @@ static int compare_matrix_params(MLPEncodeContext *ctx, const MatrixParams *prev · 16 unmodified lines
266 if (prev->count != mp->count)267 if (prev->count != mp->count)
267 return 1;268 return 1;
268 269
269 if (!prev->count)270 if (!mp->count)
270 return 0;271 return 0;
271 272
272 for (unsigned int channel = rh->min_channel; channel <= rh->max_channel; channel++)273 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
1293 1294
1294 order = ff_lpc_calc_coefs(&ctx->lpc_ctx, ctx->lpc_sample_buffer,1295 order = ff_lpc_calc_coefs(&ctx->lpc_ctx, ctx->lpc_sample_buffer,
1295 ctx->number_of_samples, MLP_MIN_LPC_ORDER,1296 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,
1297 ctx->prediction_order, MLP_MIN_LPC_SHIFT,1298 ctx->prediction_order, MLP_MIN_LPC_SHIFT,
1298 MLP_MAX_LPC_SHIFT, MLP_MIN_LPC_SHIFT);1299 MLP_MAX_LPC_SHIFT, MLP_MIN_LPC_SHIFT);
1299 1300
@@ -2160,6 +2161,7 @@ static av_cold int mlp_encode_close(AVCodecContext *avctx) · 860 unmodified lines
2160#define OFFSET(x) offsetof(MLPEncodeContext, x)2161#define OFFSET(x) offsetof(MLPEncodeContext, x)
2161static const AVOption mlp_options[] = {2162static const AVOption mlp_options[] = {
2162{ "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 },2163{ "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 },
2163{ "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" },2165{ "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" },
2164{ "levinson", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_LEVINSON }, 0, 0, FLAGS, "lpc_type" },2166{ "levinson", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_LEVINSON }, 0, 0, FLAGS, "lpc_type" },
2165{ "cholesky", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_CHOLESKY }, 0, 0, FLAGS, "lpc_type" },2167{ "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