cast to uint8_t
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7648 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
fd01583784
commit
f1d178f0f6
|
@ -169,87 +169,87 @@ int gsm0610_pack_wav49(uint8_t c[], const gsm0610_frame_t *s)
|
||||||
sr = 0;
|
sr = 0;
|
||||||
sr = (sr >> 6) | (s->LARc[0] << 10);
|
sr = (sr >> 6) | (s->LARc[0] << 10);
|
||||||
sr = (sr >> 6) | (s->LARc[1] << 10);
|
sr = (sr >> 6) | (s->LARc[1] << 10);
|
||||||
*c++ = sr >> 4;
|
*c++ = (uint8_t)(sr >> 4);
|
||||||
sr = (sr >> 5) | (s->LARc[2] << 11);
|
sr = (sr >> 5) | (s->LARc[2] << 11);
|
||||||
*c++ = sr >> 7;
|
*c++ = (uint8_t)(sr >> 7);
|
||||||
sr = (sr >> 5) | (s->LARc[3] << 11);
|
sr = (sr >> 5) | (s->LARc[3] << 11);
|
||||||
sr = (sr >> 4) | (s->LARc[4] << 12);
|
sr = (sr >> 4) | (s->LARc[4] << 12);
|
||||||
*c++ = sr >> 6;
|
*c++ = (uint8_t)(sr >> 6);
|
||||||
sr = (sr >> 4) | (s->LARc[5] << 12);
|
sr = (sr >> 4) | (s->LARc[5] << 12);
|
||||||
sr = (sr >> 3) | (s->LARc[6] << 13);
|
sr = (sr >> 3) | (s->LARc[6] << 13);
|
||||||
*c++ = sr >> 7;
|
*c++ = (uint8_t)(sr >> 7);
|
||||||
sr = (sr >> 3) | (s->LARc[7] << 13);
|
sr = (sr >> 3) | (s->LARc[7] << 13);
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
sr = (sr >> 7) | (s->Nc[i] << 9);
|
sr = (sr >> 7) | (s->Nc[i] << 9);
|
||||||
*c++ = sr >> 5;
|
*c++ = (uint8_t)(sr >> 5);
|
||||||
sr = (sr >> 2) | (s->bc[i] << 14);
|
sr = (sr >> 2) | (s->bc[i] << 14);
|
||||||
sr = (sr >> 2) | (s->Mc[i] << 14);
|
sr = (sr >> 2) | (s->Mc[i] << 14);
|
||||||
sr = (sr >> 6) | (s->xmaxc[i] << 10);
|
sr = (sr >> 6) | (s->xmaxc[i] << 10);
|
||||||
*c++ = sr >> 3;
|
*c++ = (uint8_t)(sr >> 3);
|
||||||
sr = (sr >> 3) | (s->xMc[i][0] << 13);
|
sr = (sr >> 3) | (s->xMc[i][0] << 13);
|
||||||
*c++ = sr >> 8;
|
*c++ = sr >> 8;
|
||||||
sr = (sr >> 3) | (s->xMc[i][1] << 13);
|
sr = (sr >> 3) | (s->xMc[i][1] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][2] << 13);
|
sr = (sr >> 3) | (s->xMc[i][2] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][3] << 13);
|
sr = (sr >> 3) | (s->xMc[i][3] << 13);
|
||||||
*c++ = sr >> 7;
|
*c++ = (uint8_t)(sr >> 7);
|
||||||
sr = (sr >> 3) | (s->xMc[i][4] << 13);
|
sr = (sr >> 3) | (s->xMc[i][4] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][5] << 13);
|
sr = (sr >> 3) | (s->xMc[i][5] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][6] << 13);
|
sr = (sr >> 3) | (s->xMc[i][6] << 13);
|
||||||
*c++ = sr >> 6;
|
*c++ = (uint8_t)(sr >> 6);
|
||||||
sr = (sr >> 3) | (s->xMc[i][7] << 13);
|
sr = (sr >> 3) | (s->xMc[i][7] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][8] << 13);
|
sr = (sr >> 3) | (s->xMc[i][8] << 13);
|
||||||
*c++ = sr >> 8;
|
*c++ = (uint8_t)(sr >> 8);
|
||||||
sr = (sr >> 3) | (s->xMc[i][9] << 13);
|
sr = (sr >> 3) | (s->xMc[i][9] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][10] << 13);
|
sr = (sr >> 3) | (s->xMc[i][10] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][11] << 13);
|
sr = (sr >> 3) | (s->xMc[i][11] << 13);
|
||||||
*c++ = sr >> 7;
|
*c++ = (uint8_t)(sr >> 7);
|
||||||
sr = (sr >> 3) | (s->xMc[i][12] << 13);
|
sr = (sr >> 3) | (s->xMc[i][12] << 13);
|
||||||
}
|
}
|
||||||
/*endfor*/
|
/*endfor*/
|
||||||
|
|
||||||
s++;
|
s++;
|
||||||
sr = (sr >> 6) | (s->LARc[0] << 10);
|
sr = (sr >> 6) | (s->LARc[0] << 10);
|
||||||
*c++ = sr >> 6;
|
*c++ = (uint8_t)(sr >> 6);
|
||||||
sr = (sr >> 6) | (s->LARc[1] << 10);
|
sr = (sr >> 6) | (s->LARc[1] << 10);
|
||||||
*c++ = sr >> 8;
|
*c++ = (uint8_t)(sr >> 8);
|
||||||
sr = (sr >> 5) | (s->LARc[2] << 11);
|
sr = (sr >> 5) | (s->LARc[2] << 11);
|
||||||
sr = (sr >> 5) | (s->LARc[3] << 11);
|
sr = (sr >> 5) | (s->LARc[3] << 11);
|
||||||
*c++ = sr >> 6;
|
*c++ = (uint8_t)(sr >> 6);
|
||||||
sr = (sr >> 4) | (s->LARc[4] << 12);
|
sr = (sr >> 4) | (s->LARc[4] << 12);
|
||||||
sr = (sr >> 4) | (s->LARc[5] << 12);
|
sr = (sr >> 4) | (s->LARc[5] << 12);
|
||||||
*c++ = sr >> 6;
|
*c++ = (uint8_t)(sr >> 6);
|
||||||
sr = (sr >> 3) | (s->LARc[6] << 13);
|
sr = (sr >> 3) | (s->LARc[6] << 13);
|
||||||
sr = (sr >> 3) | (s->LARc[7] << 13);
|
sr = (sr >> 3) | (s->LARc[7] << 13);
|
||||||
*c++ = sr >> 8;
|
*c++ = (uint8_t)(sr >> 8);
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
sr = (sr >> 7) | (s->Nc[i] << 9);
|
sr = (sr >> 7) | (s->Nc[i] << 9);
|
||||||
sr = (sr >> 2) | (s->bc[i] << 14);
|
sr = (sr >> 2) | (s->bc[i] << 14);
|
||||||
*c++ = sr >> 7;
|
*c++ = (uint8_t)(sr >> 7);
|
||||||
sr = (sr >> 2) | (s->Mc[i] << 14);
|
sr = (sr >> 2) | (s->Mc[i] << 14);
|
||||||
sr = (sr >> 6) | (s->xmaxc[i] << 10);
|
sr = (sr >> 6) | (s->xmaxc[i] << 10);
|
||||||
*c++ = sr >> 7;
|
*c++ = (uint8_t)(sr >> 7);
|
||||||
sr = (sr >> 3) | (s->xMc[i][0] << 13);
|
sr = (sr >> 3) | (s->xMc[i][0] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][1] << 13);
|
sr = (sr >> 3) | (s->xMc[i][1] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][2] << 13);
|
sr = (sr >> 3) | (s->xMc[i][2] << 13);
|
||||||
*c++ = sr >> 6;
|
*c++ = (uint8_t)(sr >> 6);
|
||||||
sr = (sr >> 3) | (s->xMc[i][3] << 13);
|
sr = (sr >> 3) | (s->xMc[i][3] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][4] << 13);
|
sr = (sr >> 3) | (s->xMc[i][4] << 13);
|
||||||
*c++ = sr >> 8;
|
*c++ = (uint8_t)(sr >> 8);
|
||||||
sr = (sr >> 3) | (s->xMc[i][5] << 13);
|
sr = (sr >> 3) | (s->xMc[i][5] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][6] << 13);
|
sr = (sr >> 3) | (s->xMc[i][6] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][7] << 13);
|
sr = (sr >> 3) | (s->xMc[i][7] << 13);
|
||||||
*c++ = sr >> 7;
|
*c++ = (uint8_t)(sr >> 7);
|
||||||
sr = (sr >> 3) | (s->xMc[i][8] << 13);
|
sr = (sr >> 3) | (s->xMc[i][8] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][9] << 13);
|
sr = (sr >> 3) | (s->xMc[i][9] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][10] << 13);
|
sr = (sr >> 3) | (s->xMc[i][10] << 13);
|
||||||
*c++ = sr >> 6;
|
*c++ = (uint8_t)(sr >> 6);
|
||||||
sr = (sr >> 3) | (s->xMc[i][11] << 13);
|
sr = (sr >> 3) | (s->xMc[i][11] << 13);
|
||||||
sr = (sr >> 3) | (s->xMc[i][12] << 13);
|
sr = (sr >> 3) | (s->xMc[i][12] << 13);
|
||||||
*c++ = sr >> 8;
|
*c++ = (uint8_t)(sr >> 8);
|
||||||
}
|
}
|
||||||
/*endfor*/
|
/*endfor*/
|
||||||
return 65;
|
return 65;
|
||||||
|
|
|
@ -423,9 +423,9 @@ int ima_adpcm_encode(ima_adpcm_state_t *s,
|
||||||
i = 0;
|
i = 0;
|
||||||
if (s->chunk_size == 0)
|
if (s->chunk_size == 0)
|
||||||
{
|
{
|
||||||
ima_data[bytes++] = amp[1];
|
ima_data[bytes++] = (uint8_t)amp[1];
|
||||||
ima_data[bytes++] = amp[1] >> 8;
|
ima_data[bytes++] = amp[1] >> 8;
|
||||||
ima_data[bytes++] = s->step_index;
|
ima_data[bytes++] = (uint8_t)s->step_index;
|
||||||
ima_data[bytes++] = 0;
|
ima_data[bytes++] = 0;
|
||||||
s->last = amp[1];
|
s->last = amp[1];
|
||||||
s->bits = 0;
|
s->bits = 0;
|
||||||
|
@ -443,9 +443,9 @@ int ima_adpcm_encode(ima_adpcm_state_t *s,
|
||||||
case IMA_ADPCM_DVI4:
|
case IMA_ADPCM_DVI4:
|
||||||
if (s->chunk_size == 0)
|
if (s->chunk_size == 0)
|
||||||
{
|
{
|
||||||
ima_data[bytes++] = s->last >> 8;
|
ima_data[bytes++] = (uint8_t) (s->last >> 8);
|
||||||
ima_data[bytes++] = s->last;
|
ima_data[bytes++] = (uint8_t) s->last;
|
||||||
ima_data[bytes++] = s->step_index;
|
ima_data[bytes++] = (uint8_t) s->step_index;
|
||||||
ima_data[bytes++] = 0;
|
ima_data[bytes++] = 0;
|
||||||
}
|
}
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
|
@ -460,9 +460,9 @@ int ima_adpcm_encode(ima_adpcm_state_t *s,
|
||||||
case IMA_ADPCM_VDVI:
|
case IMA_ADPCM_VDVI:
|
||||||
if (s->chunk_size == 0)
|
if (s->chunk_size == 0)
|
||||||
{
|
{
|
||||||
ima_data[bytes++] = s->last >> 8;
|
ima_data[bytes++] = (uint8_t) (s->last >> 8);
|
||||||
ima_data[bytes++] = s->last;
|
ima_data[bytes++] = (uint8_t) s->last;
|
||||||
ima_data[bytes++] = s->step_index;
|
ima_data[bytes++] = (uint8_t) s->step_index;
|
||||||
ima_data[bytes++] = 0;
|
ima_data[bytes++] = 0;
|
||||||
}
|
}
|
||||||
s->bits = 0;
|
s->bits = 0;
|
||||||
|
|
Loading…
Reference in New Issue