Skip to content

Commit

Permalink
delete experimental presets.
Browse files Browse the repository at this point in the history
  • Loading branch information
aikiriao committed Sep 18, 2024
1 parent f3c12cb commit fa98ac3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ You can change compression mode by `-m` option.
Following example encoding in maximum compression (but slow) option.

```bash
./srla -e -m 16 INPUT.wav OUTPUT.srl
./srla -e -m 4 INPUT.wav OUTPUT.srl
```
#### Max block size `-B`

Expand Down
4 changes: 2 additions & 2 deletions include/srla.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define SRLA_FORMAT_VERSION 4

/* コーデックバージョン */
#define SRLA_CODEC_VERSION 6
#define SRLA_CODEC_VERSION 7

/* ヘッダサイズ */
#define SRLA_HEADER_SIZE 29
Expand All @@ -19,7 +19,7 @@
#define SRLA_MAX_COEFFICIENT_ORDER 256

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


/* API結果型 */
Expand Down
16 changes: 1 addition & 15 deletions libs/srla_internal/src/srla_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,16 @@ SRLA_STATIC_ASSERT((1 << SRLA_LPC_COEFFICIENT_BITWIDTH) == SRLA_NUM_ARRAY_ELEMEN
/* 和を取った係数のハフマン木 */
static struct StaticHuffmanTree st_sum_parameter_huffman_tree = { 0, };


/* マージンリスト候補配列 */
static const double margin_list[] = { 0.0, 1.0 / 4096, 1.0 / 1024, 1.0 / 256, 1.0 / 64, 1.0 / 16 };

/* パラメータプリセット配列 */
const struct SRLAParameterPreset g_srla_parameter_preset[] = {
{ 32, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_MAX_FIXED, 0, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 32, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_MAX_FIXED, 10, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 16, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_BRUTEFORCE_ESTIMATION, 0, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 32, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_BRUTEFORCE_ESTIMATION, 0, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 32, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_BRUTEFORCE_ESTIMATION, 10, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 32, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_BRUTEFORCE_SEARCH, 0, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 32, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_BRUTEFORCE_SEARCH, 10, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 64, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_MAX_FIXED, 0, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 64, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_MAX_FIXED, 10, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 64, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_BRUTEFORCE_ESTIMATION, 0, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 64, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_BRUTEFORCE_ESTIMATION, 10, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 128, SRLA_CH_PROCESS_METHOD_TACTICS_ADAPTIVE, SRLA_LPC_ORDER_DECISION_TACTICS_MAX_FIXED, 0, SRLA_DEFINE_ARRAY_AND_NUM_ELEMTNS_TUPLE(margin_list) },
{ 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);

Expand Down
6 changes: 3 additions & 3 deletions tools/srla_codec/srla_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#include <sys/stat.h>

/* デフォルトプリセット */
#define DEFALUT_PRESET_NO 12
#define DEFALUT_PRESET_INDEX 2
/* デフォルトの最大ブロックサンプル数 */
#define DEFALUT_MAX_NUM_BLOCK_SAMPLES 4096
/* デフォルトの可変ブロック分割数 */
#define DEFALUT_NUM_VARIABLE_BLOCK_DIVISIONS 1
/* パラメータプリセットの最大インデックス */
#define SRLA_MAX_PARAMETER_PRESETS_INDEX 17
#define SRLA_MAX_PARAMETER_PRESETS_INDEX 4
#if SRLA_MAX_PARAMETER_PRESETS_INDEX != (SRLA_NUM_PARAMETER_PRESETS - 1)
#error "Max parameter presets mismatched to number of parameter presets!"
#endif
Expand Down Expand Up @@ -336,7 +336,7 @@ int main(int argc, char** argv)
}
} else if (CommandLineParser_GetOptionAcquired(command_line_spec, "encode") == COMMAND_LINE_PARSER_TRUE) {
/* エンコード */
uint32_t encode_preset_no = DEFALUT_PRESET_NO;
uint32_t encode_preset_no = DEFALUT_PRESET_INDEX;
uint32_t max_num_block_samples = DEFALUT_MAX_NUM_BLOCK_SAMPLES;
uint32_t variable_block_num_divisions = DEFALUT_NUM_VARIABLE_BLOCK_DIVISIONS;
/* エンコードプリセット番号取得 */
Expand Down

0 comments on commit fa98ac3

Please sign in to comment.