Skip to content

Commit

Permalink
Clean Up + Fixes for some C/C++ compilers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Youjose authored Dec 11, 2022
1 parent 1a78e71 commit b88a88a
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 221 deletions.
4 changes: 2 additions & 2 deletions CriCodecs/adx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ bool Decode(int *d,unsigned char *s, AdxHeader header, int* coeffs){
scale = 1 << (12 - scale);
}else if(header.encoding == 2){
scale = (scale & 0x1fff) + 1;
static const signed short static_coeffs[8] = {0x0000,0x0000,0x0F00,0x0000,0x1CC0,0xF300,0x1880,0xF240};
static const signed short static_coeffs[8] = {0x0000,0x0000,0x0F00,0x0000,0x1CC0,(signed short)0xF300,0x1880,(signed short)0xF240};
coeffs[0] = static_coeffs[predictor*2 + 0];
coeffs[1] = static_coeffs[predictor*2 + 1];
}else{
Expand Down Expand Up @@ -239,7 +239,7 @@ static PyObject* AdxEncode(PyObject* self, PyObject* args){
int* coeffs = new int [2];
coeffs = CalculateCoefficients(coeffs, highpass_freq, header.fmtSamplingRate);
if((Filter == 0 || Filter == 1 || Filter == 2 || Filter == 3) && highpass_freq == 0 && encoding_ver == 2){
static const signed short static_coeffs[8] = {0x0000,0x0000,0x0F00,0x0000,0x1CC0,0xF300,0x1880,0xF240};
static const signed short static_coeffs[8] = {0x0000,0x0000,0x0F00,0x0000,0x1CC0,(signed short)0xF300,0x1880,(signed short)0xF240};
coeffs[0] = static_coeffs[Filter*2 + 0];
coeffs[1] = static_coeffs[Filter*2 + 1];
}
Expand Down
Loading

0 comments on commit b88a88a

Please sign in to comment.