Skip to content
Commits on Source (24)
......@@ -138,6 +138,7 @@ stages:
- mv IVAS_rend_test IVAS_rend
.merge-request-comparison-check: &merge-request-comparison-check
- echo "--------------- Running merge-request-comparison-check anchor ---------------"
- if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
- if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "Non-bitexact cases without non-BE tag encountered!"; exit $EXIT_CODE_FAIL; fi
- if [ $exit_code -eq 1 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi
......
......@@ -1690,6 +1690,13 @@ static bool parseCmdlIVAS_enc(
i++;
}
#ifdef FIX_643_PCA_OPTION
else if ( strcmp( argv_to_upper, "-PCA" ) == 0 )
{
arg->pca = 1;
i++;
}
#else
else if ( strcmp( argv_to_upper, "-BYPASS" ) == 0 ) // TODO: should be renamed to "-pca"
{
i++;
......@@ -1723,6 +1730,7 @@ static bool parseCmdlIVAS_enc(
return false;
}
}
#endif
/*-----------------------------------------------------------------*
* Option not recognized
......@@ -1919,7 +1927,11 @@ static void usage_enc( void )
fprintf( stdout, "-mime : Mime output bitstream file format\n" );
fprintf( stdout, " The encoder produces TS26.445 Annex.2.6 Mime Storage Format, (not RFC4867 Mime Format).\n" );
fprintf( stdout, " default output bitstream file format is G.192\n" );
#ifdef FIX_643_PCA_OPTION
fprintf( stdout, "-pca : activate PCA in SBA format FOA at 256 kbps \n" );
#else
fprintf( stdout, "-bypass mode : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1\n" );
#endif
fprintf( stdout, "-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" );
fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" );
#ifdef DEBUGGING
......
......@@ -1335,11 +1335,18 @@ typedef struct {
unsigned short length[81];
} HUFF_ELEMENTS;
#ifdef FIX_891_PARAMUPMIX_CLEANUP
typedef struct {
HUFF_ELEMENTS df0;
HUFF_ELEMENTS df;
} HUFF_TABLE;
#else
typedef struct {
HUFF_ELEMENTS df0;
HUFF_ELEMENTS df;
HUFF_ELEMENTS dt;
} HUFF_TABLE;
#endif
typedef enum {
ALPHA,
......
......@@ -156,6 +156,7 @@
#define FIX_890_ARRAY_SIZE /* Nokia: issue #890: mismatch in 2D array size declaration and use */
#define BE_FIX_887_GCC_WARNING_ARRAY_SIZE /* VoiceAge: Issue 887: change array size definition to avoid warning with gcc 11.4.0 */
#define FIX_247_EXTERNAL_RENDERER_COMMAND_LINE /* VA: issue 247: harmonize command-line options names of external renderer with the decoder */
#define FIX_643_PCA_OPTION /* VA: issue 643: rename PCA bypass command-line option */
#define FIX_891_PARAMUPMIX_CLEANUP /* Dlb: issue 891: remove unneeded code from ParamUpmix */
/* #################### End BE switches ################################## */
......
......@@ -1360,34 +1360,42 @@ static void huffman_decode(
int32_t *vq )
{
const int16_t( *huff_node_table )[2];
int16_t iv, bdt, nquant, offset;
#ifdef FIX_891_PARAMUPMIX_CLEANUP
int16_t iv, nquant, offset;
nquant = 0;
switch ( parType )
{
#ifdef FIX_891_PARAMUPMIX_CLEANUP
case ALPHA:
nquant = ivas_mc_paramupmix_alpha_quant_table.nquant;
break;
case BETA:
nquant = ivas_mc_paramupmix_beta_quant_table[0].nquant;
break;
default:
assert( 0 );
}
offset = nquant - 1; /* range of df [-(nquant - 1), nquant - 1] */
#else
int16_t iv, bdt, nquant, offset;
nquant = 0;
switch ( parType )
{
case ALPHA:
nquant = ivas_mc_paramupmix_alpha_quant_table[quant_type].nquant;
break;
case BETA:
nquant = ivas_mc_paramupmix_beta_quant_table[quant_type][0].nquant;
break;
#endif
default:
assert( 0 );
}
offset = nquant - 1; /* range of df/dt [-(nquant - 1), nquant - 1] */
#endif
#ifdef FIX_891_PARAMUPMIX_CLEANUP
bdt = st->bit_stream[st->next_bit_pos];
st->next_bit_pos++;
#else
if ( bNoDt )
......@@ -1400,76 +1408,61 @@ static void huffman_decode(
st->next_bit_pos++;
}
#endif
if ( bdt )
{ /* Get dt */
#ifdef FIX_891_PARAMUPMIX_CLEANUP
switch ( parType )
{
#ifdef FIX_891_PARAMUPMIX_CLEANUP
case ALPHA:
huff_node_table = ivas_mc_paramupmix_huff_nodes_dt.alpha;
huff_node_table = ivas_mc_paramupmix_huff_nodes_df0.alpha;
break;
case BETA:
huff_node_table = ivas_mc_paramupmix_huff_nodes_dt.beta;
huff_node_table = ivas_mc_paramupmix_huff_nodes_df0.beta;
break;
default:
huff_node_table = NULL;
assert( 0 );
}
for ( iv = 0; iv < IVAS_MAX_NUM_BANDS; iv++ )
vq[0] = huff_read( st, huff_node_table );
switch ( parType )
{
vq[iv] = huff_read( st, huff_node_table ) + vq[iv] - offset;
}
#else
case ALPHA:
huff_node_table = ivas_mc_paramupmix_huff_nodes_dt.alpha[quant_type];
huff_node_table = ivas_mc_paramupmix_huff_nodes_df.alpha;
break;
case BETA:
huff_node_table = ivas_mc_paramupmix_huff_nodes_dt.beta[quant_type];
huff_node_table = ivas_mc_paramupmix_huff_nodes_df.beta;
break;
default:
huff_node_table = NULL;
assert( 0 );
}
for ( iv = ivStart; iv < nv; iv++ )
for ( iv = 1; iv < IVAS_MAX_NUM_BANDS; iv++ )
{
vq[iv] = huff_read( st, huff_node_table ) + vq[iv] - offset;
}
#endif
vq[iv] = huff_read( st, huff_node_table ) + vq[iv - 1] - offset;
}
else /* Get f0, df */
{
#else
if ( bdt )
{ /* Get dt */
switch ( parType )
{
#ifdef FIX_891_PARAMUPMIX_CLEANUP
case ALPHA:
huff_node_table = ivas_mc_paramupmix_huff_nodes_df0.alpha;
huff_node_table = ivas_mc_paramupmix_huff_nodes_dt.alpha[quant_type];
break;
case BETA:
huff_node_table = ivas_mc_paramupmix_huff_nodes_df0.beta;
huff_node_table = ivas_mc_paramupmix_huff_nodes_dt.beta[quant_type];
break;
default:
huff_node_table = NULL;
assert( 0 );
}
vq[0] = huff_read( st, huff_node_table );
switch ( parType )
for ( iv = ivStart; iv < nv; iv++ )
{
case ALPHA:
huff_node_table = ivas_mc_paramupmix_huff_nodes_df.alpha;
break;
case BETA:
huff_node_table = ivas_mc_paramupmix_huff_nodes_df.beta;
break;
default:
assert( 0 );
vq[iv] = huff_read( st, huff_node_table ) + vq[iv] - offset;
}
for ( iv = 1; iv < IVAS_MAX_NUM_BANDS; iv++ )
{
vq[iv] = huff_read( st, huff_node_table ) + vq[iv - 1] - offset;
}
#else
else /* Get f0, df */
{
switch ( parType )
{
case ALPHA:
huff_node_table = ivas_mc_paramupmix_huff_nodes_df0.alpha[quant_type];
break;
......@@ -1498,8 +1491,8 @@ static void huffman_decode(
{
vq[iv] = huff_read( st, huff_node_table ) + vq[iv - 1] - offset;
}
#endif
}
#endif
return;
}
......
......@@ -57,7 +57,7 @@ static void ivas_mc_paramupmix_dmx( MC_PARAMUPMIX_ENC_HANDLE hMCParamUpmix, floa
static void ivas_mc_paramupmix_param_est_enc( MC_PARAMUPMIX_ENC_HANDLE hMCParamUpmix, float *input_frame_t[], const int16_t input_frame, float alphas[MC_PARAMUPMIX_COMBINATIONS][IVAS_MAX_NUM_BANDS], float betas[MC_PARAMUPMIX_COMBINATIONS][IVAS_MAX_NUM_BANDS] );
#ifdef FIX_891_PARAMUPMIX_CLEANUP
static void get_huff_table( const PAR_TYPE par_type, HUFF_TAB *df0, HUFF_TAB *df, HUFF_TAB *dt );
static void get_huff_table( const PAR_TYPE par_type, HUFF_TAB *df0, HUFF_TAB *df );
#else
static void get_huff_table( const PAR_TYPE par_type, const QUANT_TYPE quant_type, HUFF_TAB *df0, HUFF_TAB *df, HUFF_TAB *dt );
#endif
......@@ -374,10 +374,13 @@ static void get_huff_table(
const PAR_TYPE par_type,
#ifndef FIX_891_PARAMUPMIX_CLEANUP
const QUANT_TYPE quant_type,
#endif
HUFF_TAB *df0,
HUFF_TAB *df,
HUFF_TAB *dt )
#else
HUFF_TAB *df0,
HUFF_TAB *df )
#endif
{
switch ( par_type )
{
......@@ -387,16 +390,12 @@ static void get_huff_table(
df0->length = huff_alpha_table.df0.length;
df->value = huff_alpha_table.df.value;
df->length = huff_alpha_table.df.length;
dt->value = huff_alpha_table.dt.value;
dt->length = huff_alpha_table.dt.length;
break;
case BETA:
df0->value = huff_beta_table.df0.value;
df0->length = huff_beta_table.df0.length;
df->value = huff_beta_table.df.value;
df->length = huff_beta_table.df.length;
dt->value = huff_beta_table.dt.value;
dt->length = huff_beta_table.dt.length;
break;
#else
case ALPHA:
......@@ -463,10 +462,14 @@ static void huffman_encode(
#endif
int32_t icode;
int16_t offset;
#ifdef FIX_891_PARAMUPMIX_CLEANUP
HUFF_TAB df0, df;
#else
HUFF_TAB df0, df, dt;
#endif
#ifdef FIX_891_PARAMUPMIX_CLEANUP
get_huff_table( parType, &df0, &df, &dt );
get_huff_table( parType, &df0, &df );
#else
get_huff_table( parType, quant_type, &df0, &df, &dt );
#endif
......
......@@ -750,22 +750,6 @@ const HUFF_TABLE huff_alpha_table =
9, 10, 10, 11, 11, 12, 12, 12, 13, 13,
14, 15, 15, 16, 16, 17, 16, 16, 17, 16,
16, 17, 17, 17, 13 }
},
{ /* dt */
{ 0x00eeee, 0x03b3ee, 0x03b3f6, 0x03b3fc, 0x01d9bc, 0x01d9bd, 0x01d9b2, 0x03b3fe, 0x01d9be, 0x01d9f6,
0x01d9fc, 0x00ecda, 0x00ecfa, 0x00eeef, 0x00766e, 0x007776, 0x003b3a, 0x003bba, 0x001d9a, 0x001ddc,
0x001dde, 0x000eec, 0x000764, 0x000772, 0x0003b0, 0x0003b8, 0x0001da, 0x0001de, 0x000072, 0x000038,
0x00001e, 0x000006, 0x000000, 0x000002, 0x00001f, 0x00003a, 0x000073, 0x0001df, 0x0001db, 0x0003ba,
0x0003b1, 0x000773, 0x000765, 0x000eed, 0x000ecc, 0x001d9e, 0x001d9c, 0x003bbe, 0x003b3b, 0x00777e,
0x00767c, 0x00eefe, 0x00ecfc, 0x00ecd8, 0x01d9fd, 0x01d9fa, 0x01d9bf, 0x01d9b6, 0x01d9b3, 0x03b3fd,
0x01d9b7, 0x03b3ff, 0x03b3ef, 0x03b3f7, 0x00eeff },
{ 16, 18, 18, 18, 17, 17, 17, 18, 17, 17,
17, 16, 16, 16, 15, 15, 14, 14, 13, 13,
13, 12, 11, 11, 10, 10, 9, 9, 7, 6,
5, 3, 1, 2, 5, 6, 7, 9, 9, 10,
10, 11, 11, 12, 12, 13, 13, 14, 14, 15,
15, 16, 16, 16, 17, 17, 17, 17, 17, 18,
17, 18, 18, 18, 16 }
}
};
......@@ -780,12 +764,6 @@ const HUFF_TABLE huff_beta_table =
0x00000e, 0x00007f, 0x0000fb, 0x0001f3, 0x0001f0, 0x0007c6, 0x001f1f },
{ 13, 12, 10, 9, 8, 7, 5, 3, 1, 2,
4, 7, 8, 9, 9, 11, 13 }
},
{ /* dt */
{ 0x007dfe, 0x003efe, 0x000fbe, 0x0003ee, 0x0000fa, 0x00007e, 0x00001e, 0x000006, 0x000000, 0x000002,
0x00000e, 0x00007f, 0x00007c, 0x0001f6, 0x0007de, 0x001f7e, 0x007dff },
{ 15, 14, 12, 10, 8, 7, 5, 3, 1, 2,
4, 7, 7, 9, 11, 13, 15 }
}
};
#else
......
......@@ -224,7 +224,7 @@ EVS mono is default, for IVAS choose one of the following: -stereo, -ism, -sba,
-mime : Mime output bitstream file format
The encoder produces TS26.445 Annex.2.6 Mime Storage Format, (not RFC4867 Mime Format).
default output bitstream file format is G.192
-bypass mode : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1
-pca : activate PCA in SBA format FOA at 256 kbps
-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation.
Currently, all values default to level 3 (full functionality).
-q : Quiet mode, limit printouts to terminal, default is deactivated
......
......@@ -143,7 +143,7 @@ def sba_dec_plc(
# ------------ run cmd ------------
tag_out = f"{tag}_ivasbr{ivas_br[:-3]}k_DTX{dtx}"
if gain_flag == 1:
if gain_flag != -1:
tag_out += f'_Gain{gain_flag}'
plc_tag_out = f"{tag_out}_{plc_pattern}"
......
......@@ -69,7 +69,6 @@ ivas_br_HOA2 = ["256000", "384000", "512000"]
ivas_br_HOA3 = ["256000", "384000", "512000"]
SID_list = [0, 1]
sample_rate_list = ["48", "32", "16"]
bypass_list = [1, 2]
gain_list = [0, 1]
sample_rate_bw_idx_list = [("48", "SWB"), ("48", "WB"), ("32", "WB")]
......@@ -89,8 +88,7 @@ def check_and_makedir(dir_path):
@pytest.mark.create_ref
@pytest.mark.parametrize("tag", tag_list)
@pytest.mark.parametrize("fs", sample_rate_list)
@pytest.mark.parametrize("bypass", bypass_list)
def test_bypass_enc(
def test_pca_enc(
dut_encoder_frontend: EncoderFrontend,
dut_decoder_frontend: DecoderFrontend,
test_vector_path,
......@@ -102,11 +100,8 @@ def test_bypass_enc(
keep_files,
tag,
fs,
bypass,
):
if update_ref == 1 and bypass == 1:
pytest.skip()
pca = True
tag = tag + fs + "c"
ivas_br = "256000"
dtx = "0"
......@@ -129,11 +124,11 @@ def test_bypass_enc(
dtx,
None,
max_bw,
bypass,
sba_order,
update_ref,
gain_flag,
cut_testv=True,
pca=pca,
)
# dec
......@@ -148,11 +143,11 @@ def test_bypass_enc(
dtx,
None,
max_bw,
bypass,
output_config,
update_ref,
gain_flag,
keep_files,
pca=pca,
)
......@@ -197,7 +192,6 @@ def test_sba_enc_system(
pytest.skip()
tag = tag + fs + "c"
max_bw = "FB"
bypass = -1
sba_order = "+1"
output_config = "FOA"
if gain_flag == 1:
......@@ -220,7 +214,6 @@ def test_sba_enc_system(
dtx,
SID,
max_bw,
bypass,
sba_order,
update_ref,
gain_flag,
......@@ -241,7 +234,6 @@ def test_sba_enc_system(
dtx,
SID,
max_bw,
bypass,
output_config,
update_ref,
gain_flag,
......@@ -271,7 +263,6 @@ def test_spar_hoa2_enc_system(
tag = tag + fs + "c"
max_bw = "FB"
bypass = -1
sba_order = "+2"
output_config = "HOA2"
......@@ -289,7 +280,6 @@ def test_spar_hoa2_enc_system(
dtx,
None,
max_bw,
bypass,
sba_order,
update_ref,
gain_flag,
......@@ -307,7 +297,6 @@ def test_spar_hoa2_enc_system(
dtx,
None,
max_bw,
bypass,
output_config,
update_ref,
gain_flag,
......@@ -337,7 +326,6 @@ def test_spar_hoa3_enc_system(
tag = tag + fs + "c"
max_bw = "FB"
bypass = -1
sba_order = "+3"
output_config = "HOA3"
......@@ -355,7 +343,6 @@ def test_spar_hoa3_enc_system(
dtx,
None,
max_bw,
bypass,
sba_order,
update_ref,
gain_flag,
......@@ -373,7 +360,6 @@ def test_spar_hoa3_enc_system(
dtx,
None,
max_bw,
bypass,
output_config,
update_ref,
gain_flag,
......@@ -411,7 +397,6 @@ def test_sba_enc_BWforce_system(
fs = sample_rate_bw_idx[0]
bw = sample_rate_bw_idx[1]
tag = tag + fs + "c"
bypass = -1
gain_flag = -1
sba_order = "+1"
output_config = "FOA"
......@@ -430,7 +415,6 @@ def test_sba_enc_BWforce_system(
dtx,
None,
bw,
bypass,
sba_order,
update_ref,
gain_flag,
......@@ -449,7 +433,6 @@ def test_sba_enc_BWforce_system(
dtx,
None,
bw,
bypass,
output_config,
update_ref,
gain_flag,
......@@ -472,13 +455,13 @@ def sba_enc(
dtx,
SID,
ivas_max_bw,
bypass,
sba_order,
update_ref,
gain_flag,
cut_gain="1.0",
create_dutenc=False,
cut_testv=False,
pca=False,
):
# ------------ run cmd ------------
dut_out_dir = f"{dut_base_path}/sba_bs/pkt"
......@@ -499,18 +482,16 @@ def sba_enc(
if ivas_br == "sw_24k4_256k.bin":
ivas_br = f"{br_switch_file_path}/sw_24k4_256k.bin"
short_tag_ext = ""
if gain_flag == 1:
if gain_flag != -1:
short_tag_ext += f"_Gain{gain_flag}"
if SID == 1:
short_tag_ext += f"_SID"
# we update only bypass = 0/2 (bypass 1 is the same as the baseline)
if bypass in [0, 2]:
short_tag_ext += f"_pca{bypass}"
if pca:
short_tag_ext += f"_pca"
# to avoid conflicting names in case of parallel test execution, differentiate all cases
if gain_flag == 1:
long_tag_ext = f"_Gain{gain_flag}"
else:
long_tag_ext = f"_pca{bypass}"
long_tag_ext = ""
if gain_flag != -1:
long_tag_ext += f"_Gain{gain_flag}"
if SID == 1:
long_tag_ext += f"_SID"
dut_pkt_file = f"{dut_out_dir}/{tag_out}{long_tag_ext}.pkt"
......@@ -523,7 +504,6 @@ def sba_enc(
f"{ref_out_dir}/{tag_out}{short_tag_ext}_dutenc_cut.pkt"
)
input_path = f"{test_vector_path}/{tag_in}{in_extension}"
bypass_mode = bypass if bypass >= 0 else None
dtx_mode = dtx == "1"
if cut_testv:
......@@ -557,7 +537,7 @@ def sba_enc(
ref_pkt_file,
sba_order=sba_order,
max_band=ivas_max_bw,
bypass_mode=bypass_mode,
pca=pca,
dtx_mode=dtx_mode,
)
if create_dutenc:
......@@ -569,7 +549,7 @@ def sba_enc(
ref_pkt_file_dutenc,
sba_order=sba_order,
max_band=ivas_max_bw,
bypass_mode=bypass_mode,
pca=pca,
dtx_mode=dtx_mode,
)
......@@ -582,7 +562,7 @@ def sba_enc(
dut_pkt_file,
sba_order=sba_order,
max_band=ivas_max_bw,
bypass_mode=bypass_mode,
pca=pca,
dtx_mode=dtx_mode,
)
......@@ -614,11 +594,11 @@ def sba_dec(
dtx,
SID,
ivas_max_bw,
bypass,
output_config,
update_ref,
gain_flag,
keep_files,
pca=False,
):
# -------- run cmd ------------
# sampling rate to BW mapping
......@@ -629,18 +609,16 @@ def sba_dec(
tag_out = f"{tag}_ivasbr{ivas_br[:-3]}k_DTX{dtx}"
short_tag_ext = ""
if gain_flag == 1:
if gain_flag != -1:
short_tag_ext += f"_Gain{gain_flag}"
# we update only bypass = 0/2 (bypass 1 is the same as the baseline)
if bypass in [0, 2]:
short_tag_ext += f"_pca{bypass}"
if pca:
short_tag_ext += f"_pca"
if SID == 1:
short_tag_ext += f"_SID_cut"
# to avoid conflicting names in case of parallel test execution, differentiate all cases
if gain_flag == 1:
long_tag_ext = f"_Gain{gain_flag}"
else:
long_tag_ext = f"_pca{bypass}"
long_tag_ext = ""
if gain_flag != -1:
long_tag_ext += f"_Gain{gain_flag}"
if SID == 1:
long_tag_ext += f"_SID_cut"
dut_out_dir = f"{dut_base_path}/sba_bs/raw"
......
......@@ -223,7 +223,7 @@ class EncoderFrontend:
sba_order: Optional[str] = None,
dtx_mode: Optional[bool] = False,
max_band: Optional[str] = None,
bypass_mode: Optional[int] = None,
pca: Optional[bool] = None,
quiet_mode: Optional[bool] = True,
add_option_list: Optional[list] = None,
) -> None:
......@@ -239,8 +239,8 @@ class EncoderFrontend:
if max_band is not None:
command.extend(["-max_band", max_band])
if bypass_mode is not None:
command.extend(["-bypass", str(bypass_mode)])
if pca:
command.extend(["-pca"])
if quiet_mode:
command.extend(["-q"])
......