Skip to content

Commit

Permalink
increase number of presets.
Browse files Browse the repository at this point in the history
  • Loading branch information
aikiriao committed Jun 22, 2024
1 parent 85eb6d8 commit 3cd5717
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions include/srla.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define SRLA_FORMAT_VERSION 2

/* コーデックバージョン */
#define SRLA_CODEC_VERSION 4
#define SRLA_CODEC_VERSION 5

/* ヘッダサイズ */
#define SRLA_HEADER_SIZE 29
Expand All @@ -16,10 +16,10 @@
#define SRLA_MAX_NUM_CHANNELS 8

/* 最大係数サイズ */
#define SRLA_MAX_COEFFICIENT_ORDER 128
#define SRLA_MAX_COEFFICIENT_ORDER 256

/* パラメータプリセット数 */
#define SRLA_NUM_PARAMETER_PRESETS 14
#define SRLA_NUM_PARAMETER_PRESETS 18


/* API結果型 */
Expand Down
2 changes: 1 addition & 1 deletion libs/srla_internal/include/srla_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/* LPC係数右シフト量のビット幅 */
#define SRLA_RSHIFT_LPC_COEFFICIENT_BITWIDTH 4
/* (LPC係数次数-1)のビット幅 */
#define SRLA_LPC_COEFFICIENT_ORDER_BITWIDTH 7
#define SRLA_LPC_COEFFICIENT_ORDER_BITWIDTH 8
/* 圧縮をやめて生データを出力するときの閾値(サンプルあたりビット数に占める比率) */
#define SRLA_ESTIMATED_CODELENGTH_THRESHOLD 0.95f
/* LPCのリッジ正則化パラメータ */
Expand Down
4 changes: 4 additions & 0 deletions libs/srla_internal/src/srla_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const struct SRLAParameterPreset g_srla_parameter_preset[] = {
{ 128, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_MAX_FIXED, 10, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 128, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_BRUTEFORCE_ESTIMATION, 0, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 128, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_BRUTEFORCE_ESTIMATION, 10, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 256, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_MAX_FIXED, 0, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 256, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_MAX_FIXED, 10, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 256, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_BRUTEFORCE_ESTIMATION, 0, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 256, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_BRUTEFORCE_ESTIMATION, 10, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
};

SRLA_STATIC_ASSERT(SRLA_NUM_ARRAY_ELEMENTS(g_srla_parameter_preset) == SRLA_NUM_PARAMETER_PRESETS);
4 changes: 2 additions & 2 deletions tools/srla_codec/srla_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <sys/stat.h>

/* デフォルトプリセット */
#define DEFALUT_PRESET_NO 8
#define DEFALUT_PRESET_NO 12
/* デフォルトの最大ブロックサンプル数 */
#define DEFALUT_MAX_NUM_BLOCK_SAMPLES 4096
/* デフォルトの可変ブロック分割数 */
Expand All @@ -27,7 +27,7 @@ static struct CommandLineParserSpecification command_line_spec[] = {
COMMAND_LINE_PARSER_FALSE, NULL, COMMAND_LINE_PARSER_FALSE },
{ 'd', "decode", "Decode mode",
COMMAND_LINE_PARSER_FALSE, NULL, COMMAND_LINE_PARSER_FALSE },
{ 'm', "mode", "Specify compress mode: 0(fast), ..., 13(high compression) (default:" TOSTRING(DEFALUT_PRESET_NO) ")",
{ 'm', "mode", "Specify compress mode: 0(fast), ..., " TOSTRING(SRLA_NUM_PARAMETER_PRESETS) "(high compression) (default:" TOSTRING(DEFALUT_PRESET_NO) ")",
COMMAND_LINE_PARSER_TRUE, NULL, COMMAND_LINE_PARSER_FALSE },
{ 'B', "max-block-size", "Specify max number of block samples (default:" TOSTRING(DEFALUT_MAX_NUM_BLOCK_SAMPLES) ")",
COMMAND_LINE_PARSER_TRUE, NULL, COMMAND_LINE_PARSER_FALSE },
Expand Down

0 comments on commit 3cd5717

Please sign in to comment.