[FFmpeg-soc] [soc]: r5527 - in amr: amrnbdata.h amrnbdec.c
vitor
subversion at mplayerhq.hu
Sat Dec 12 14:29:49 CET 2009
Author: vitor
Date: Sat Dec 12 14:29:49 2009
New Revision: 5527
Log:
Change pulse data structure in a way it can be reused by SIPR
Modified:
amr/amrnbdata.h
amr/amrnbdec.c
Modified: amr/amrnbdata.h
==============================================================================
--- amr/amrnbdata.h Fri Dec 11 22:25:06 2009 (r5526)
+++ amr/amrnbdata.h Sat Dec 12 14:29:49 2009 (r5527)
@@ -406,43 +406,43 @@ static const AMROrder order_MODE_12k2[24
AMR_LSF ( 4, 5), AMR_LSF ( 4, 4), AMR_LSF ( 4, 3), AMR_LSF ( 4, 2),
AMR_PGAIN(0, 0), AMR_PGAIN(1, 0), AMR_PGAIN(2, 0), AMR_PGAIN(3, 0),
AMR_FGAIN(0, 1), AMR_FGAIN(1, 1), AMR_FGAIN(2, 1), AMR_FGAIN(3, 1),
- AMR_PULSE(0,0, 3), AMR_PULSE(1,0, 3), AMR_PULSE(2,0, 3), AMR_PULSE(3,0, 3),
AMR_PULSE(0,1, 3), AMR_PULSE(1,1, 3), AMR_PULSE(2,1, 3), AMR_PULSE(3,1, 3),
- AMR_FGAIN(0, 0), AMR_FGAIN(1, 0), AMR_FGAIN(2, 0), AMR_FGAIN(3, 0),
- AMR_PULSE(0,2, 3), AMR_PULSE(1,2, 3), AMR_PULSE(2,2, 3), AMR_PULSE(3,2, 3),
AMR_PULSE(0,3, 3), AMR_PULSE(1,3, 3), AMR_PULSE(2,3, 3), AMR_PULSE(3,3, 3),
- AMR_PULSE(0,4, 3), AMR_PULSE(1,4, 3), AMR_PULSE(2,4, 3), AMR_PULSE(3,4, 3),
- AMR_LSF ( 4, 1), AMR_LSF ( 4, 0), AMR_PULSE(0,0, 0), AMR_PULSE(0,0, 1),
- AMR_PULSE(0,0, 2), AMR_PULSE(0,1, 0), AMR_PULSE(0,1, 1), AMR_PULSE(0,1, 2),
- AMR_PULSE(0,2, 0), AMR_PULSE(0,2, 1), AMR_PULSE(0,2, 2), AMR_PULSE(0,3, 0),
- AMR_PULSE(0,3, 1), AMR_PULSE(0,3, 2), AMR_PULSE(0,4, 0), AMR_PULSE(0,4, 1),
- AMR_PULSE(0,4, 2), AMR_PULSE(1,0, 0), AMR_PULSE(1,0, 1), AMR_PULSE(1,0, 2),
- AMR_PULSE(1,1, 0), AMR_PULSE(1,1, 1), AMR_PULSE(1,1, 2), AMR_PULSE(1,2, 0),
- AMR_PULSE(1,2, 1), AMR_PULSE(1,2, 2), AMR_PULSE(1,3, 0), AMR_PULSE(1,3, 1),
- AMR_PULSE(1,3, 2), AMR_PULSE(1,4, 0), AMR_PULSE(1,4, 1), AMR_PULSE(1,4, 2),
- AMR_PULSE(2,0, 0), AMR_PULSE(2,0, 1), AMR_PULSE(2,0, 2), AMR_PULSE(2,1, 0),
- AMR_PULSE(2,1, 1), AMR_PULSE(2,1, 2), AMR_PULSE(2,2, 0), AMR_PULSE(2,2, 1),
- AMR_PULSE(2,2, 2), AMR_PULSE(2,3, 0), AMR_PULSE(2,3, 1), AMR_PULSE(2,3, 2),
- AMR_PULSE(2,4, 0), AMR_PULSE(2,4, 1), AMR_PULSE(2,4, 2), AMR_PULSE(3,0, 0),
- AMR_PULSE(3,0, 1), AMR_PULSE(3,0, 2), AMR_PULSE(3,1, 0), AMR_PULSE(3,1, 1),
- AMR_PULSE(3,1, 2), AMR_PULSE(3,2, 0), AMR_PULSE(3,2, 1), AMR_PULSE(3,2, 2),
- AMR_PULSE(3,3, 0), AMR_PULSE(3,3, 1), AMR_PULSE(3,3, 2), AMR_PULSE(3,4, 0),
- AMR_PULSE(3,4, 1), AMR_PULSE(3,4, 2), AMR_PULSE(0,5, 0), AMR_PULSE(0,5, 1),
- AMR_PULSE(0,5, 2), AMR_PULSE(0,6, 0), AMR_PULSE(0,6, 1), AMR_PULSE(0,6, 2),
- AMR_PULSE(0,7, 0), AMR_PULSE(0,7, 1), AMR_PULSE(0,7, 2), AMR_PULSE(0,8, 0),
- AMR_PULSE(0,8, 1), AMR_PULSE(0,8, 2), AMR_PULSE(0,9, 0), AMR_PULSE(0,9, 1),
- AMR_PULSE(0,9, 2), AMR_PULSE(1,5, 0), AMR_PULSE(1,5, 1), AMR_PULSE(1,5, 2),
- AMR_PULSE(1,6, 0), AMR_PULSE(1,6, 1), AMR_PULSE(1,6, 2), AMR_PULSE(1,7, 0),
- AMR_PULSE(1,7, 1), AMR_PULSE(1,7, 2), AMR_PULSE(1,8, 0), AMR_PULSE(1,8, 1),
- AMR_PULSE(1,8, 2), AMR_PULSE(1,9, 0), AMR_PULSE(1,9, 1), AMR_PULSE(1,9, 2),
- AMR_PULSE(2,5, 0), AMR_PULSE(2,5, 1), AMR_PULSE(2,5, 2), AMR_PULSE(2,6, 0),
- AMR_PULSE(2,6, 1), AMR_PULSE(2,6, 2), AMR_PULSE(2,7, 0), AMR_PULSE(2,7, 1),
- AMR_PULSE(2,7, 2), AMR_PULSE(2,8, 0), AMR_PULSE(2,8, 1), AMR_PULSE(2,8, 2),
- AMR_PULSE(2,9, 0), AMR_PULSE(2,9, 1), AMR_PULSE(2,9, 2), AMR_PULSE(3,5, 0),
- AMR_PULSE(3,5, 1), AMR_PULSE(3,5, 2), AMR_PULSE(3,6, 0), AMR_PULSE(3,6, 1),
- AMR_PULSE(3,6, 2), AMR_PULSE(3,7, 0), AMR_PULSE(3,7, 1), AMR_PULSE(3,7, 2),
- AMR_PULSE(3,8, 0), AMR_PULSE(3,8, 1), AMR_PULSE(3,8, 2), AMR_PULSE(3,9, 0),
- AMR_PULSE(3,9, 1), AMR_PULSE(3,9, 2), AMR_PLAG (1, 0), AMR_PLAG (3, 0)
+ AMR_FGAIN(0, 0), AMR_FGAIN(1, 0), AMR_FGAIN(2, 0), AMR_FGAIN(3, 0),
+ AMR_PULSE(0,5, 3), AMR_PULSE(1,5, 3), AMR_PULSE(2,5, 3), AMR_PULSE(3,5, 3),
+ AMR_PULSE(0,7, 3), AMR_PULSE(1,7, 3), AMR_PULSE(2,7, 3), AMR_PULSE(3,7, 3),
+ AMR_PULSE(0,9, 3), AMR_PULSE(1,9, 3), AMR_PULSE(2,9, 3), AMR_PULSE(3,9, 3),
+ AMR_LSF ( 4, 1), AMR_LSF ( 4, 0), AMR_PULSE(0,1, 0), AMR_PULSE(0,1, 1),
+ AMR_PULSE(0,1, 2), AMR_PULSE(0,3, 0), AMR_PULSE(0,3, 1), AMR_PULSE(0,3, 2),
+ AMR_PULSE(0,5, 0), AMR_PULSE(0,5, 1), AMR_PULSE(0,5, 2), AMR_PULSE(0,7, 0),
+ AMR_PULSE(0,7, 1), AMR_PULSE(0,7, 2), AMR_PULSE(0,9, 0), AMR_PULSE(0,9, 1),
+ AMR_PULSE(0,9, 2), AMR_PULSE(1,1, 0), AMR_PULSE(1,1, 1), AMR_PULSE(1,1, 2),
+ AMR_PULSE(1,3, 0), AMR_PULSE(1,3, 1), AMR_PULSE(1,3, 2), AMR_PULSE(1,5, 0),
+ AMR_PULSE(1,5, 1), AMR_PULSE(1,5, 2), AMR_PULSE(1,7, 0), AMR_PULSE(1,7, 1),
+ AMR_PULSE(1,7, 2), AMR_PULSE(1,9, 0), AMR_PULSE(1,9, 1), AMR_PULSE(1,9, 2),
+ AMR_PULSE(2,1, 0), AMR_PULSE(2,1, 1), AMR_PULSE(2,1, 2), AMR_PULSE(2,3, 0),
+ AMR_PULSE(2,3, 1), AMR_PULSE(2,3, 2), AMR_PULSE(2,5, 0), AMR_PULSE(2,5, 1),
+ AMR_PULSE(2,5, 2), AMR_PULSE(2,7, 0), AMR_PULSE(2,7, 1), AMR_PULSE(2,7, 2),
+ AMR_PULSE(2,9, 0), AMR_PULSE(2,9, 1), AMR_PULSE(2,9, 2), AMR_PULSE(3,1, 0),
+ AMR_PULSE(3,1, 1), AMR_PULSE(3,1, 2), AMR_PULSE(3,3, 0), AMR_PULSE(3,3, 1),
+ AMR_PULSE(3,3, 2), AMR_PULSE(3,5, 0), AMR_PULSE(3,5, 1), AMR_PULSE(3,5, 2),
+ AMR_PULSE(3,7, 0), AMR_PULSE(3,7, 1), AMR_PULSE(3,7, 2), AMR_PULSE(3,9, 0),
+ AMR_PULSE(3,9, 1), AMR_PULSE(3,9, 2), AMR_PULSE(0,0, 0), AMR_PULSE(0,0, 1),
+ AMR_PULSE(0,0, 2), AMR_PULSE(0,2, 0), AMR_PULSE(0,2, 1), AMR_PULSE(0,2, 2),
+ AMR_PULSE(0,4, 0), AMR_PULSE(0,4, 1), AMR_PULSE(0,4, 2), AMR_PULSE(0,6, 0),
+ AMR_PULSE(0,6, 1), AMR_PULSE(0,6, 2), AMR_PULSE(0,8, 0), AMR_PULSE(0,8, 1),
+ AMR_PULSE(0,8, 2), AMR_PULSE(1,0, 0), AMR_PULSE(1,0, 1), AMR_PULSE(1,0, 2),
+ AMR_PULSE(1,2, 0), AMR_PULSE(1,2, 1), AMR_PULSE(1,2, 2), AMR_PULSE(1,4, 0),
+ AMR_PULSE(1,4, 1), AMR_PULSE(1,4, 2), AMR_PULSE(1,6, 0), AMR_PULSE(1,6, 1),
+ AMR_PULSE(1,6, 2), AMR_PULSE(1,8, 0), AMR_PULSE(1,8, 1), AMR_PULSE(1,8, 2),
+ AMR_PULSE(2,0, 0), AMR_PULSE(2,0, 1), AMR_PULSE(2,0, 2), AMR_PULSE(2,2, 0),
+ AMR_PULSE(2,2, 1), AMR_PULSE(2,2, 2), AMR_PULSE(2,4, 0), AMR_PULSE(2,4, 1),
+ AMR_PULSE(2,4, 2), AMR_PULSE(2,6, 0), AMR_PULSE(2,6, 1), AMR_PULSE(2,6, 2),
+ AMR_PULSE(2,8, 0), AMR_PULSE(2,8, 1), AMR_PULSE(2,8, 2), AMR_PULSE(3,0, 0),
+ AMR_PULSE(3,0, 1), AMR_PULSE(3,0, 2), AMR_PULSE(3,2, 0), AMR_PULSE(3,2, 1),
+ AMR_PULSE(3,2, 2), AMR_PULSE(3,4, 0), AMR_PULSE(3,4, 1), AMR_PULSE(3,4, 2),
+ AMR_PULSE(3,6, 0), AMR_PULSE(3,6, 1), AMR_PULSE(3,6, 2), AMR_PULSE(3,8, 0),
+ AMR_PULSE(3,8, 1), AMR_PULSE(3,8, 2), AMR_PLAG (1, 0), AMR_PLAG (3, 0)
};
static const AMROrder order_MODE_DTX[35] = {
Modified: amr/amrnbdec.c
==============================================================================
--- amr/amrnbdec.c Fri Dec 11 22:25:06 2009 (r5526)
+++ amr/amrnbdec.c Sat Dec 12 14:29:49 2009 (r5527)
@@ -473,13 +473,13 @@ static void decode_10_pulses_35bits(cons
fixed_sparse->n = 10;
for (i = 0; i < 5; i++) {
- const int pos1 = gray_decode[fixed_index[i ] & 7] * 5 + i;
- const int pos2 = gray_decode[fixed_index[i + 5] & 7] * 5 + i;
- const float sign = (fixed_index[i] & 8) ? -1.0 : 1.0;
- fixed_sparse->x[i ] = pos1;
- fixed_sparse->x[i + 5] = pos2;
- fixed_sparse->y[i ] = sign;
- fixed_sparse->y[i + 5] = pos2 < pos1 ? -sign : sign;
+ const int pos1 = gray_decode[fixed_index[2*i + 1] & 7] * 5 + i;
+ const int pos2 = gray_decode[fixed_index[2*i ] & 7] * 5 + i;
+ const float sign = (fixed_index[2*i + 1] & 8) ? -1.0 : 1.0;
+ fixed_sparse->x[2*i + 1] = pos1;
+ fixed_sparse->x[2*i ] = pos2;
+ fixed_sparse->y[2*i + 1] = sign;
+ fixed_sparse->y[2*i ] = pos2 < pos1 ? -sign : sign;
}
}
More information about the FFmpeg-soc
mailing list