Skip to content

Commit

Permalink
Fix for the OAR issue with 24 channel stream. (#69)
Browse files Browse the repository at this point in the history
Testing:

[x] Conformance tested.

Co-authored-by: Sai Vamsi Chunchula <[email protected]>
  • Loading branch information
Vamsi100858 and Sai Vamsi Chunchula authored Oct 10, 2023
1 parent 49c13ae commit cebf3df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions decoder/impeghd_obj_ren_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const WORD32 ia_loud_speaker_subset_B[LS_SUBSET_B_LEN] = {CH_M_L045, CH_M_R045,
const WORD32 ia_loud_speaker_subset_C[LS_SUBSET_C_LEN] = {CH_M_L110, CH_U_L110, CH_U_R110,
CH_M_R110};

const WORD32 ia_loud_speaker_subset_D[LS_SUBSET_D_LEN] = {CH_M_L135, CH_U_R135, CH_U_L135,
const WORD32 ia_loud_speaker_subset_D[LS_SUBSET_D_LEN] = {CH_M_L135, CH_U_L135, CH_U_R135,
CH_M_R135};

/**
Expand Down Expand Up @@ -350,6 +350,7 @@ static WORD32 impeghd_ls_subset_empty(ia_renderer_ls_params *ptr_ls_vertex, WORD
WORD32 flag_poly;
FLOAT32 polygon[OBJ_REN_MAX_VERTICES];
FLOAT32 vertices[OBJ_REN_MAX_VERTICES];
FLOAT32 offset = ptr_ls_vertex->offset;

for (i = 0; i < num_sub_ls; i++)
{
Expand All @@ -372,11 +373,11 @@ static WORD32 impeghd_ls_subset_empty(ia_renderer_ls_params *ptr_ls_vertex, WORD
point[0] = ptr_ls_vertex[j].ls_azimuth;

flag_poly = 1;
FLOAT32 front = 180 - (FLOAT32)fmod(180 - point[0], 360);
FLOAT32 front = 180 - (FLOAT32)fmod((180 + offset) - point[0], 360);
for (index = 0; index < num_sub_ls; index++)
{
vertices[2 * index + 0] =
ia_sub_flt(180 - (FLOAT32)fmod(180 - polygon[2 * index], 360), front);
ia_sub_flt(180 - (FLOAT32)fmod((180 + offset) - polygon[2 * index], 360), front);
vertices[2 * index + 1] = ia_sub_flt(polygon[2 * index + 1], point[1]);
}

Expand Down Expand Up @@ -591,6 +592,7 @@ impeghd_add_imaginary_ls(ia_obj_ren_dec_state_struct *ptr_obj_ren_dec_state, pVO
i = impeghd_adjust_ele_azi_ind(ptr_obj_ren_dec_state, &num_imag_ls, &max_ele_spk_idx,
&min_ele_spk_idx);
/* Step 3 Check if subset A speaker set is present in the speaker layout */
ptr_obj_ren_dec_state->non_lfe_ls_str[0].offset = 0.0f;
flag = impeghd_ls_subset_exist(&ptr_obj_ren_dec_state->non_lfe_ls_str[0],
(WORD32 *)&ia_loud_speaker_subset_A[0], LS_SUBSET_A_LEN,
(num_ls + num_imag_ls),
Expand All @@ -614,6 +616,7 @@ impeghd_add_imaginary_ls(ia_obj_ren_dec_state_struct *ptr_obj_ren_dec_state, pVO
else
{
/* Step 3 Check if subset B speaker set is present in the speaker layout */
ptr_obj_ren_dec_state->non_lfe_ls_str[0].offset = 0.0f;
flag = impeghd_ls_subset_exist(&ptr_obj_ren_dec_state->non_lfe_ls_str[0],
(WORD32 *)&ia_loud_speaker_subset_B[0], LS_SUBSET_B_LEN,
(num_ls + num_imag_ls),
Expand All @@ -638,6 +641,7 @@ impeghd_add_imaginary_ls(ia_obj_ren_dec_state_struct *ptr_obj_ren_dec_state, pVO
}

/* Step 4 Check if subset C speaker set is present in the speaker layout */
ptr_obj_ren_dec_state->non_lfe_ls_str[0].offset = 180.0f;
flag = impeghd_ls_subset_exist(&ptr_obj_ren_dec_state->non_lfe_ls_str[0],
(WORD32 *)&ia_loud_speaker_subset_C[0], LS_SUBSET_C_LEN,
(num_ls + num_imag_ls),
Expand All @@ -663,6 +667,7 @@ impeghd_add_imaginary_ls(ia_obj_ren_dec_state_struct *ptr_obj_ren_dec_state, pVO
else
{
/* Step 4 Check if subset D speaker set is present in the speaker layout */
ptr_obj_ren_dec_state->non_lfe_ls_str[0].offset = 180.0f;
flag = impeghd_ls_subset_exist(&ptr_obj_ren_dec_state->non_lfe_ls_str[0],
(WORD32 *)&ia_loud_speaker_subset_D[0], LS_SUBSET_D_LEN,
(num_ls + num_imag_ls),
Expand Down
1 change: 1 addition & 0 deletions decoder/impeghd_obj_ren_dec_struct_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ typedef struct
WORD32 ls_index;
WORD32 ls_order;
ia_cart_coord_str ls_cart_coord;
FLOAT32 offset;
} ia_renderer_ls_params;

typedef struct
Expand Down

0 comments on commit cebf3df

Please sign in to comment.