Skip to content
This repository was archived by the owner on Jan 17, 2019. It is now read-only.

Commit 06a42dd

Browse files
authored
Merge pull request #107 from singalsu/eq_iir_fix_assign_integer_type
EQ: Fix an integer type bug in IIR coefficients blob packer
2 parents b76776b + 0913d7c commit 06a42dd

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

tune/eq/eq_iir_blob_pack.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@
4141
endian = 'little';
4242
end
4343

44+
%% Channels count and assign vector lengths must be the same
45+
if bs.platform_max_channels ~= length( bs.assign_response)
46+
bs
47+
error("Channels # and response assign length must match");
48+
end
49+
4450
%% Shift values for little/big endian
4551
switch lower(endian)
4652
case 'little'
@@ -63,12 +69,14 @@
6369
blob8(j:j+3) = w2b(bs.number_of_responses_defined, sh); j=j+4;
6470

6571
for i=1:bs.platform_max_channels
66-
blob8(j:j+3) = w2b(bs.assign_response(i), sh); j=j+4;
72+
blob8(j:j+3) = w2b(int32(bs.assign_response(i)), sh);
73+
j=j+4;
6774
end
6875

6976
%% Pack coefficients
7077
for i=1:length(bs.all_coefficients)
71-
blob8(j:j+3) = w2b(bs.all_coefficients(i), sh); j=j+4;
78+
blob8(j:j+3) = w2b(int32(bs.all_coefficients(i)), sh);
79+
j=j+4;
7280
end
7381
fprintf('Blob size is %d bytes.\n', nbytes);
7482

0 commit comments

Comments
 (0)