[FFmpeg-soc] [soc]AMR-WB decoder branch, master, updated.
Marcelo Póvoa
marspeoplester at gmail.com
Thu Jul 8 23:50:01 CEST 2010
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "AMR-WB decoder".
The branch, master has been updated
via 9c54ab79501afa169d9ef4fb056ce6297ce29c0c (commit)
via 62edbb15efb610589c2cc3da4c4994f957f5b7e8 (commit)
from e2c98c9adc19b9a7a33fb161da62cd7e25d52a75 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9c54ab79501afa169d9ef4fb056ce6297ce29c0c
Author: Marcelo Povoa <marspeoplester at gmail.com>
Date: Thu Jul 8 18:46:14 2010 -0300
Finish pulse index decoding for all modes
diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index a9d6fad..7b069ce 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -456,7 +456,8 @@ static void decode_3p_track(int *out, int code, int m, int off)
{ ///code: 3m+1 bits
int half_2p = BIT_POS(code, 2*m - 1) << (m - 1);
- decode_2p_track(out, BIT_STR(code, 0, 2*m - 1), m - 1, off + half_2p);
+ decode_2p_track(out, BIT_STR(code, 0, 2*m - 1),
+ m - 1, off + half_2p);
decode_1p_track(out + 2, BIT_STR(code, 2*m, m + 1), m, off);
}
@@ -497,6 +498,52 @@ static void decode_4p_track(int *out, int code, int m, int off)
}
}
+static void decode_5p_track(int *out, int code, int m, int off)
+{ ///code: 5m bits
+ int half_3p = BIT_POS(code, 5*m - 1) << (m - 1);
+
+ decode_3p_track(out, BIT_STR(code, 2*m, 3*m - 2),
+ m - 1, off + half_3p);
+ //XXX: there seems to be a typo in I3p expoent (from reference)
+ decode_2p_track(out + 3, BIT_STR(code, 0, 2*m + 1), m, off);
+}
+
+static void decode_6p_track(int *out, int code, int m, int off)
+{ ///code: 6m-2 bits
+ int b_offset = 1 << (m - 1);
+ /* which half has more pulses in cases 0 to 2 */
+ int half_more = BIT_POS(code, 6*m - 5) << (m - 1);
+ int half_other = b_offset - half_more;
+
+ switch (BIT_STR(code, 6*m - 4, 2)) /* case ID (2 bits) */
+ {
+ case 0: /* 0 pulses in A, 6 pulses in B or vice-versa */
+ decode_1p_track(out, BIT_STR(code, 0, m),
+ m - 1, off + half_more);
+ decode_5p_track(out + 1, BIT_STR(code, m, 5*m - 5),
+ m - 1, off + half_more);
+ break;
+ case 1: /* 1 pulse in A, 5 pulses in B or vice-versa */
+ decode_1p_track(out, BIT_STR(code, 0, m),
+ m - 1, off + half_other);
+ decode_5p_track(out + 1, BIT_STR(code, m, 5*m - 5),
+ m - 1, off + half_more);
+ break;
+ case 2: /* 2 pulses in A, 4 pulses in B or vice-versa */
+ decode_2p_track(out, BIT_STR(code, 0, 2*m - 1),
+ m - 1, off + half_other);
+ decode_4p_track(out + 2, BIT_STR(code, 2*m - 1, 4*m - 4),
+ m - 1, off + half_more);
+ break;
+ case 3: /* 3 pulses in A, 3 pulses in B */
+ decode_3p_track(out, BIT_STR(code, 3*m - 2, 3*m - 2),
+ m - 1, off);
+ decode_3p_track(out + 3, BIT_STR(code, 0, 3*m - 2),
+ m - 1, off + b_offset);
+ break;
+ }
+}
+
/**
* Decode the algebraic codebook index to pulse positions and signs,
* then construct the algebraic codebook vector.
@@ -543,9 +590,23 @@ static void decode_fixed_sparse(AMRFixed *fixed_sparse, const uint16_t *pulse_hi
break;
case MODE_18k25:
for (i = 0; i < 4; i++)
- decode_4p_track(sig_pos[i], (int) pulse_lo[i] +
+ decode_4p_track(sig_pos[i], (int) pulse_lo[i] +
+ ((int) pulse_hi[i] << 14), 4, 0);
+ break;
+ case MODE_19k85:
+ for (i = 0; i < 2; i++)
+ decode_5p_track(sig_pos[i], (int) pulse_lo[i] +
+ ((int) pulse_hi[i] << 10), 4, 0);
+ for (i = 2; i < 4; i++)
+ decode_4p_track(sig_pos[i], (int) pulse_lo[i] +
((int) pulse_hi[i] << 14), 4, 0);
break;
+ case MODE_23k05:
+ case MODE_23k85:
+ for (i = 0; i < 4; i++)
+ decode_6p_track(sig_pos[i], (int) pulse_lo[i] +
+ ((int) pulse_hi[i] << 11), 4, 0);
+ break;
}
for (i = 0; i < 4; i++)
commit 62edbb15efb610589c2cc3da4c4994f957f5b7e8
Author: Marcelo Povoa <marspeoplester at gmail.com>
Date: Thu Jul 8 18:34:24 2010 -0300
Correct some typos in the reordering tables
diff --git a/libavcodec/amrwbdata.h b/libavcodec/amrwbdata.h
index 632589a..ecb748a 100644
--- a/libavcodec/amrwbdata.h
+++ b/libavcodec/amrwbdata.h
@@ -407,13 +407,13 @@ static const uint16_t order_MODE_19k85[] = {
334, 260,
2, AMR_OF(0, pul_ih[2]), 124, 148,
2, AMR_OF(0, pul_ih[3]), 132, 136,
- 10, AMR_OF(0, pul_ih[0]), 349, 113, 173, 206, 303, 375, 253, 283,
+ 10, AMR_OF(0, pul_il[0]), 349, 113, 173, 206, 303, 375, 253, 283,
338, 384,
10, AMR_OF(0, pul_il[1]), 350, 111, 161, 195, 286, 369, 245, 266,
320, 385,
- 14, AMR_OF(0, pul_ih[2]), 138, 172, 292, 363, 226, 213, 307, 227,
+ 14, AMR_OF(0, pul_il[2]), 138, 172, 292, 363, 226, 213, 307, 227,
201, 207, 261, 288, 318, 366,
- 14, AMR_OF(0, pul_ih[3]), 151, 187, 285, 361, 222, 223, 306, 221,
+ 14, AMR_OF(0, pul_il[3]), 151, 187, 285, 361, 222, 223, 306, 221,
198, 177, 242, 280, 299, 360,
7, AMR_OF(0, vq), 3, 20, 42, 28, 32, 38, 24,
6, AMR_OF(1, adap), 36, 49, 72, 77, 83, 98,
@@ -424,13 +424,13 @@ static const uint16_t order_MODE_19k85[] = {
329, 296,
2, AMR_OF(1, pul_ih[2]), 122, 141,
2, AMR_OF(1, pul_ih[3]), 119, 134,
- 10, AMR_OF(1, pul_ih[0]), 346, 125, 165, 204, 295, 371, 273, 277,
+ 10, AMR_OF(1, pul_il[0]), 346, 125, 165, 204, 295, 371, 273, 277,
319, 382,
10, AMR_OF(1, pul_il[1]), 354, 121, 162, 209, 301, 365, 251, 259,
326, 381,
- 14, AMR_OF(1, pul_ih[2]), 145, 192, 269, 356, 212, 179, 282, 246,
+ 14, AMR_OF(1, pul_il[2]), 145, 192, 269, 356, 212, 179, 282, 246,
196, 193, 244, 276, 324, 368,
- 14, AMR_OF(1, pul_ih[3]), 137, 184, 263, 358, 215, 219, 317, 234,
+ 14, AMR_OF(1, pul_il[3]), 137, 184, 263, 358, 215, 219, 317, 234,
185, 211, 248, 311, 313, 372,
7, AMR_OF(1, vq), 4, 21, 43, 29, 33, 39, 25,
9, AMR_OF(2, adap), 15, 16, 17, 18, 19, 51, 70, 80,
@@ -442,13 +442,13 @@ static const uint16_t order_MODE_19k85[] = {
332, 275,
2, AMR_OF(2, pul_ih[2]), 133, 154,
2, AMR_OF(2, pul_ih[3]), 123, 143,
- 10, AMR_OF(2, pul_ih[0]), 357, 126, 197, 241, 325, 380, 279, 278,
+ 10, AMR_OF(2, pul_il[0]), 357, 126, 197, 241, 325, 380, 279, 278,
331, 393,
10, AMR_OF(2, pul_il[1]), 352, 139, 189, 235, 330, 383, 293, 298,
341, 388,
- 14, AMR_OF(2, pul_ih[2]), 156, 228, 312, 374, 250, 249, 345, 255,
+ 14, AMR_OF(2, pul_il[2]), 156, 228, 312, 374, 250, 249, 345, 255,
231, 232, 247, 290, 316, 376,
- 14, AMR_OF(2, pul_ih[3]), 155, 214, 302, 370, 230, 208, 321, 240,
+ 14, AMR_OF(2, pul_il[3]), 155, 214, 302, 370, 230, 208, 321, 240,
194, 191, 239, 294, 305, 362,
7, AMR_OF(2, vq), 5, 22, 44, 30, 34, 40, 26,
6, AMR_OF(3, adap), 37, 50, 73, 78, 84, 99,
@@ -459,13 +459,13 @@ static const uint16_t order_MODE_19k85[] = {
327, 272,
2, AMR_OF(3, pul_ih[2]), 120, 144,
2, AMR_OF(3, pul_ih[3]), 112, 142,
- 10, AMR_OF(3, pul_ih[0]), 359, 128, 171, 233, 309, 378, 257, 264,
+ 10, AMR_OF(3, pul_il[0]), 359, 128, 171, 233, 309, 378, 257, 264,
335, 377,
10, AMR_OF(3, pul_il[1]), 348, 116, 180, 220, 310, 379, 274, 289,
342, 389,
- 14, AMR_OF(3, pul_ih[2]), 150, 199, 308, 373, 237, 216, 323, 243,
+ 14, AMR_OF(3, pul_il[2]), 150, 199, 308, 373, 237, 216, 323, 243,
205, 203, 252, 300, 322, 367,
- 14, AMR_OF(3, pul_ih[3]), 146, 218, 304, 364, 229, 217, 315, 224,
+ 14, AMR_OF(3, pul_il[3]), 146, 218, 304, 364, 229, 217, 315, 224,
200, 168, 238, 287, 284, 351,
7, AMR_OF(3, vq), 6, 23, 45, 31, 35, 41, 27,
0
-----------------------------------------------------------------------
Summary of changes:
libavcodec/amrwbdata.h | 24 +++++++++---------
libavcodec/amrwbdec.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 75 insertions(+), 14 deletions(-)
hooks/post-receive
--
AMR-WB decoder
More information about the FFmpeg-soc
mailing list