[FFmpeg-devel] AMR-NB decoder

Colin McQuillan m.niloc
Wed Aug 5 21:08:23 CEST 2009


2009/8/5 Vitor Sessak <vitor1001 at gmail.com>:
> Colin McQuillan wrote:
>>
>> 2009/8/5 Vitor Sessak <vitor1001 at gmail.com>:
>>>
>>> Hi, and good work!
>>>
>>> Colin McQuillan wrote:
>>>>
>>>> Attached is a patch for an AMR-NB decoder.
>>>>
>>>> It is not bit-exact.
>>>
>>> Neither it could be, it is float-based. The best you could get would be a
>>> stddev of ~0.05.
>>>
>>>> This makes it tricky to verify, but I have been
>>>> checking that internal parameters match the 3GPP decoder for the AMR
>>>> test sequences. The PSNR between the input and output is 3.90 to 8.42
>>>> which is about the same as the reference decoder.
>>>
>>> I suppose here you mean the stddev, not the PSNR. Also, what command are
>>> you
>>> using to compare the results? Are you setting elem_size to 2? Could you
>>> paste the output of tiny_psnr for the test vectors (and a real-world
>>> sample
>>> ideally)?
>>
>> I forgot to add elem_size to my tiny_psnr script. PSNR is now actually
>> between 20 and 80. (and from encoder input, the PSNR is about 20 to
>> 40)
>>
>> samples/A-codecs/amr/sample.amr compared against ref decoder output:
>> stddev: ? 24.22 PSNR: 68.63 bytes: ? 797760/ ? 797760
>>
>> The test vector tiny_psnr output is attached because there's 169 of them.
>>
>> soc/T_102/T00_102.raw: stddev: ? 55.89 PSNR: 61.37 bytes: ? ?90560/
>> ?90560
>> soc/T_102/T01_102.raw: stddev: 5283.25 PSNR: 21.86 bytes: ? ?90560/
>> ?90560
>> soc/T_102/T02_102.raw: stddev: ?999.99 PSNR: 36.32 bytes: ? 128000/
>> 128000
>> soc/T_102/T03_102.raw: stddev: 3327.29 PSNR: 25.88 bytes: ? 128000/
>> 128000
>> soc/T_102/T04_102.raw: stddev: ?228.36 PSNR: 49.15 bytes: ? ?95680/
>> ?95680
>> soc/T_102/T05_102.raw: stddev: ?248.60 PSNR: 48.41 bytes: ? ?71040/
>> ?71040
>> soc/T_102/T06_102.raw: stddev: ? 65.63 PSNR: 59.98 bytes: ? 106560/
>> 106560
>> soc/T_102/T07_102.raw: stddev: ? 72.93 PSNR: 59.06 bytes: ? 115520/
>> 115520
>> soc/T_102/T08_102.raw: stddev: 1831.37 PSNR: 31.06 bytes: ? 108160/
>> 108160
>> soc/T_102/T09_102.raw: stddev: ? 47.08 PSNR: 62.86 bytes: ? 129600/
>> 129600
>
> Wow, that's a pretty variated bunch. It really gives an impression that
> there is some feature that is not properly decoded (an psnr of 22 is pretty
> low). Does the output of T01_102.raw sounds the same as the ref decoder?

T01_102.raw was different, I made a mistake with how I clip samples
and didn't rerun the tests. After reverting this change, the psnr's
are as attached.

The T02/T03 tests still have a high PSNR but do sound the same as the
ref decoder. T02/T03 are pure tones going from low to high. A pure
tone will be encoded in AMR (or any CELP codec) using feedback. This
explains why the floating-point decoder differs so much from the ref
output - errors can accumulate. The internal parameters are all very
close to the reference decoder. Unfortunately I don't know how to test
the output to show whether it's just a difference in phase.
-------------- next part --------------
soc/T_102/T00_102.raw: stddev:   55.85 PSNR: 61.38 bytes:    90560/    90560
soc/T_102/T01_102.raw: stddev:  195.86 PSNR: 50.48 bytes:    90560/    90560
soc/T_102/T02_102.raw: stddev:  999.99 PSNR: 36.32 bytes:   128000/   128000
soc/T_102/T03_102.raw: stddev: 1191.95 PSNR: 34.79 bytes:   128000/   128000
soc/T_102/T04_102.raw: stddev:  228.36 PSNR: 49.15 bytes:    95680/    95680
soc/T_102/T05_102.raw: stddev:  248.60 PSNR: 48.41 bytes:    71040/    71040
soc/T_102/T06_102.raw: stddev:   65.63 PSNR: 59.98 bytes:   106560/   106560
soc/T_102/T07_102.raw: stddev:   72.96 PSNR: 59.06 bytes:   115520/   115520
soc/T_102/T08_102.raw: stddev:  138.43 PSNR: 53.49 bytes:   108160/   108160
soc/T_102/T09_102.raw: stddev:   47.08 PSNR: 62.86 bytes:   129600/   129600
soc/T_102/T10_102.raw: stddev:   68.63 PSNR: 59.59 bytes:   121920/   121920
soc/T_102/T11_102.raw: stddev:  214.34 PSNR: 49.70 bytes:   116800/   116800
soc/T_102/T12_102.raw: stddev:   35.11 PSNR: 65.41 bytes:    94720/    94720
soc/T_102/T13_102.raw: stddev:  100.34 PSNR: 56.29 bytes:   107520/   107520
soc/T_102/T14_102.raw: stddev:  345.34 PSNR: 45.55 bytes:   101120/   101120
soc/T_102/T15_102.raw: stddev:   38.38 PSNR: 64.64 bytes:   104320/   104320
soc/T_102/T16_102.raw: stddev:  105.72 PSNR: 55.84 bytes:   112640/   112640
soc/T_102/T17_102.raw: stddev:  359.08 PSNR: 45.22 bytes:   100480/   100480
soc/T_102/T18_102.raw: stddev:   46.16 PSNR: 63.03 bytes:   128000/   128000
soc/T_102/T19_102.raw: stddev:   24.65 PSNR: 68.48 bytes:   128000/   128000
soc/T_102/T20_102.raw: stddev:  103.28 PSNR: 56.04 bytes:   201280/   201280
soc/T_122/T00_122.raw: stddev:   84.53 PSNR: 57.78 bytes:    90560/    90560
soc/T_122/T01_122.raw: stddev:   71.21 PSNR: 59.27 bytes:    90560/    90560
soc/T_122/T02_122.raw: stddev: 1552.34 PSNR: 32.50 bytes:   128000/   128000
soc/T_122/T03_122.raw: stddev: 1818.45 PSNR: 31.13 bytes:   128000/   128000
soc/T_122/T04_122.raw: stddev:  192.10 PSNR: 50.65 bytes:    95680/    95680
soc/T_122/T05_122.raw: stddev:   69.66 PSNR: 59.46 bytes:    71040/    71040
soc/T_122/T06_122.raw: stddev:   58.04 PSNR: 61.04 bytes:   106560/   106560
soc/T_122/T07_122.raw: stddev:   58.43 PSNR: 60.99 bytes:   115520/   115520
soc/T_122/T08_122.raw: stddev:   74.60 PSNR: 58.86 bytes:   108160/   108160
soc/T_122/T09_122.raw: stddev:   42.44 PSNR: 63.76 bytes:   129600/   129600
soc/T_122/T10_122.raw: stddev:   38.95 PSNR: 64.51 bytes:   121920/   121920
soc/T_122/T11_122.raw: stddev:   87.82 PSNR: 57.45 bytes:   116800/   116800
soc/T_122/T12_122.raw: stddev:   19.55 PSNR: 70.49 bytes:    94720/    94720
soc/T_122/T13_122.raw: stddev:   38.66 PSNR: 64.57 bytes:   107520/   107520
soc/T_122/T14_122.raw: stddev:   67.82 PSNR: 59.69 bytes:   101120/   101120
soc/T_122/T15_122.raw: stddev:   26.97 PSNR: 67.70 bytes:   104320/   104320
soc/T_122/T16_122.raw: stddev:   27.30 PSNR: 67.59 bytes:   112640/   112640
soc/T_122/T17_122.raw: stddev:   71.88 PSNR: 59.19 bytes:   100480/   100480
soc/T_122/T18_122.raw: stddev:   30.83 PSNR: 66.54 bytes:   128000/   128000
soc/T_122/T19_122.raw: stddev:    7.59 PSNR: 78.71 bytes:   128000/   128000
soc/T_122/T20_122.raw: stddev:  269.55 PSNR: 47.71 bytes:   201280/   201280
soc/T_475/T00_475.raw: stddev:    8.84 PSNR: 77.39 bytes:    90560/    90560
soc/T_475/T01_475.raw: stddev:   20.38 PSNR: 70.13 bytes:    90560/    90560
soc/T_475/T02_475.raw: stddev:  707.41 PSNR: 39.33 bytes:   128000/   128000
soc/T_475/T03_475.raw: stddev:  897.32 PSNR: 37.26 bytes:   128000/   128000
soc/T_475/T04_475.raw: stddev:  152.87 PSNR: 52.63 bytes:    95680/    95680
soc/T_475/T05_475.raw: stddev:   62.70 PSNR: 60.37 bytes:    71040/    71040
soc/T_475/T06_475.raw: stddev:   45.57 PSNR: 63.14 bytes:   106560/   106560
soc/T_475/T07_475.raw: stddev:   54.63 PSNR: 61.57 bytes:   115520/   115520
soc/T_475/T08_475.raw: stddev:   57.41 PSNR: 61.14 bytes:   108160/   108160
soc/T_475/T09_475.raw: stddev:   33.16 PSNR: 65.91 bytes:   129600/   129600
soc/T_475/T10_475.raw: stddev:   40.52 PSNR: 64.16 bytes:   121920/   121920
soc/T_475/T11_475.raw: stddev:   82.78 PSNR: 57.96 bytes:   116800/   116800
soc/T_475/T12_475.raw: stddev:   19.40 PSNR: 70.56 bytes:    94720/    94720
soc/T_475/T13_475.raw: stddev:   30.70 PSNR: 66.58 bytes:   107520/   107520
soc/T_475/T14_475.raw: stddev:   70.59 PSNR: 59.34 bytes:   101120/   101120
soc/T_475/T15_475.raw: stddev:   23.93 PSNR: 68.74 bytes:   104320/   104320
soc/T_475/T16_475.raw: stddev:   24.08 PSNR: 68.68 bytes:   112640/   112640
soc/T_475/T17_475.raw: stddev:   76.92 PSNR: 58.60 bytes:   100480/   100480
soc/T_475/T18_475.raw: stddev:   28.09 PSNR: 67.35 bytes:   128000/   128000
soc/T_475/T19_475.raw: stddev:    6.50 PSNR: 80.05 bytes:   128000/   128000
soc/T_475/T20_475.raw: stddev:   30.94 PSNR: 66.51 bytes:   201280/   201280
soc/T_515/T00_515.raw: stddev:   10.56 PSNR: 75.84 bytes:    90560/    90560
soc/T_515/T01_515.raw: stddev:   21.78 PSNR: 69.56 bytes:    90560/    90560
soc/T_515/T02_515.raw: stddev:  577.06 PSNR: 41.09 bytes:   128000/   128000
soc/T_515/T03_515.raw: stddev:  745.19 PSNR: 38.87 bytes:   128000/   128000
soc/T_515/T04_515.raw: stddev:  144.94 PSNR: 53.10 bytes:    95680/    95680
soc/T_515/T05_515.raw: stddev:   61.74 PSNR: 60.51 bytes:    71040/    71040
soc/T_515/T06_515.raw: stddev:   51.63 PSNR: 62.06 bytes:   106560/   106560
soc/T_515/T07_515.raw: stddev:   48.36 PSNR: 62.63 bytes:   115520/   115520
soc/T_515/T08_515.raw: stddev:   52.43 PSNR: 61.93 bytes:   108160/   108160
soc/T_515/T09_515.raw: stddev:   29.93 PSNR: 66.80 bytes:   129600/   129600
soc/T_515/T10_515.raw: stddev:   37.47 PSNR: 64.84 bytes:   121920/   121920
soc/T_515/T11_515.raw: stddev:   83.00 PSNR: 57.94 bytes:   116800/   116800
soc/T_515/T12_515.raw: stddev:   19.66 PSNR: 70.44 bytes:    94720/    94720
soc/T_515/T13_515.raw: stddev:   31.04 PSNR: 66.48 bytes:   107520/   107520
soc/T_515/T14_515.raw: stddev:   69.79 PSNR: 59.44 bytes:   101120/   101120
soc/T_515/T15_515.raw: stddev:   20.83 PSNR: 69.94 bytes:   104320/   104320
soc/T_515/T16_515.raw: stddev:   24.78 PSNR: 68.43 bytes:   112640/   112640
soc/T_515/T17_515.raw: stddev:   77.91 PSNR: 58.49 bytes:   100480/   100480
soc/T_515/T18_515.raw: stddev:   26.45 PSNR: 67.87 bytes:   128000/   128000
soc/T_515/T19_515.raw: stddev:    7.27 PSNR: 79.08 bytes:   128000/   128000
soc/T_515/T20_515.raw: stddev:   47.51 PSNR: 62.78 bytes:   201280/   201280
  soc/T_59/T00_59.raw: stddev:   30.55 PSNR: 66.62 bytes:    90560/    90560
  soc/T_59/T01_59.raw: stddev:   36.57 PSNR: 65.05 bytes:    90560/    90560
  soc/T_59/T02_59.raw: stddev: 1028.28 PSNR: 36.08 bytes:   128000/   128000
  soc/T_59/T03_59.raw: stddev: 1189.48 PSNR: 34.81 bytes:   128000/   128000
  soc/T_59/T04_59.raw: stddev:  215.66 PSNR: 49.64 bytes:    95680/    95680
  soc/T_59/T05_59.raw: stddev:   74.47 PSNR: 58.88 bytes:    71040/    71040
  soc/T_59/T06_59.raw: stddev:   63.99 PSNR: 60.20 bytes:   106560/   106560
  soc/T_59/T07_59.raw: stddev:   62.95 PSNR: 60.34 bytes:   115520/   115520
  soc/T_59/T08_59.raw: stddev:   62.09 PSNR: 60.46 bytes:   108160/   108160
  soc/T_59/T09_59.raw: stddev:   46.35 PSNR: 63.00 bytes:   129600/   129600
  soc/T_59/T10_59.raw: stddev:   45.42 PSNR: 63.17 bytes:   121920/   121920
  soc/T_59/T11_59.raw: stddev:   84.64 PSNR: 57.77 bytes:   116800/   116800
  soc/T_59/T12_59.raw: stddev:   24.78 PSNR: 68.44 bytes:    94720/    94720
  soc/T_59/T13_59.raw: stddev:   44.85 PSNR: 63.28 bytes:   107520/   107520
  soc/T_59/T14_59.raw: stddev:   74.76 PSNR: 58.85 bytes:   101120/   101120
  soc/T_59/T15_59.raw: stddev:   33.29 PSNR: 65.87 bytes:   104320/   104320
  soc/T_59/T16_59.raw: stddev:   28.53 PSNR: 67.21 bytes:   112640/   112640
  soc/T_59/T17_59.raw: stddev:   76.62 PSNR: 58.63 bytes:   100480/   100480
  soc/T_59/T18_59.raw: stddev:   44.78 PSNR: 63.30 bytes:   128000/   128000
  soc/T_59/T19_59.raw: stddev:    7.86 PSNR: 78.40 bytes:   128000/   128000
  soc/T_59/T20_59.raw: stddev:   24.83 PSNR: 68.42 bytes:   201280/   201280
  soc/T_67/T00_67.raw: stddev:   30.31 PSNR: 66.69 bytes:    90560/    90560
  soc/T_67/T01_67.raw: stddev:   36.08 PSNR: 65.17 bytes:    90560/    90560
  soc/T_67/T02_67.raw: stddev: 1099.59 PSNR: 35.49 bytes:   128000/   128000
  soc/T_67/T03_67.raw: stddev: 1197.56 PSNR: 34.75 bytes:   128000/   128000
  soc/T_67/T04_67.raw: stddev:  214.71 PSNR: 49.68 bytes:    95680/    95680
  soc/T_67/T05_67.raw: stddev:   69.65 PSNR: 59.46 bytes:    71040/    71040
  soc/T_67/T06_67.raw: stddev:   62.37 PSNR: 60.42 bytes:   106560/   106560
  soc/T_67/T07_67.raw: stddev:   60.44 PSNR: 60.69 bytes:   115520/   115520
  soc/T_67/T08_67.raw: stddev:   66.38 PSNR: 59.88 bytes:   108160/   108160
  soc/T_67/T09_67.raw: stddev:   43.93 PSNR: 63.46 bytes:   129600/   129600
  soc/T_67/T10_67.raw: stddev:   44.29 PSNR: 63.39 bytes:   121920/   121920
  soc/T_67/T11_67.raw: stddev:   86.98 PSNR: 57.53 bytes:   116800/   116800
  soc/T_67/T12_67.raw: stddev:   27.06 PSNR: 67.67 bytes:    94720/    94720
  soc/T_67/T13_67.raw: stddev:   48.34 PSNR: 62.63 bytes:   107520/   107520
  soc/T_67/T14_67.raw: stddev:   75.86 PSNR: 58.72 bytes:   101120/   101120
  soc/T_67/T15_67.raw: stddev:   32.27 PSNR: 66.14 bytes:   104320/   104320
  soc/T_67/T16_67.raw: stddev:   27.84 PSNR: 67.42 bytes:   112640/   112640
  soc/T_67/T17_67.raw: stddev:   78.43 PSNR: 58.43 bytes:   100480/   100480
  soc/T_67/T18_67.raw: stddev:   39.98 PSNR: 64.28 bytes:   128000/   128000
  soc/T_67/T19_67.raw: stddev:    7.19 PSNR: 79.17 bytes:   128000/   128000
  soc/T_67/T20_67.raw: stddev:   26.65 PSNR: 67.80 bytes:   201280/   201280
  soc/T_74/T00_74.raw: stddev:   33.75 PSNR: 65.75 bytes:    90560/    90560
  soc/T_74/T01_74.raw: stddev:   39.81 PSNR: 64.32 bytes:    90560/    90560
  soc/T_74/T02_74.raw: stddev: 1047.29 PSNR: 35.92 bytes:   128000/   128000
  soc/T_74/T03_74.raw: stddev: 1308.07 PSNR: 33.99 bytes:   128000/   128000
  soc/T_74/T04_74.raw: stddev:  193.33 PSNR: 50.59 bytes:    95680/    95680
  soc/T_74/T05_74.raw: stddev:   73.69 PSNR: 58.97 bytes:    71040/    71040
  soc/T_74/T06_74.raw: stddev:   62.03 PSNR: 60.47 bytes:   106560/   106560
  soc/T_74/T07_74.raw: stddev:   66.45 PSNR: 59.87 bytes:   115520/   115520
  soc/T_74/T08_74.raw: stddev:   65.11 PSNR: 60.05 bytes:   108160/   108160
  soc/T_74/T09_74.raw: stddev:   44.62 PSNR: 63.33 bytes:   129600/   129600
  soc/T_74/T10_74.raw: stddev:   46.02 PSNR: 63.06 bytes:   121920/   121920
  soc/T_74/T11_74.raw: stddev:   92.66 PSNR: 56.98 bytes:   116800/   116800
  soc/T_74/T12_74.raw: stddev:   25.26 PSNR: 68.27 bytes:    94720/    94720
  soc/T_74/T13_74.raw: stddev:   44.52 PSNR: 63.35 bytes:   107520/   107520
  soc/T_74/T14_74.raw: stddev:   79.50 PSNR: 58.31 bytes:   101120/   101120
  soc/T_74/T15_74.raw: stddev:   29.90 PSNR: 66.80 bytes:   104320/   104320
  soc/T_74/T16_74.raw: stddev:   29.94 PSNR: 66.79 bytes:   112640/   112640
  soc/T_74/T17_74.raw: stddev:   85.17 PSNR: 57.71 bytes:   100480/   100480
  soc/T_74/T18_74.raw: stddev:   36.57 PSNR: 65.06 bytes:   128000/   128000
  soc/T_74/T19_74.raw: stddev:    8.39 PSNR: 77.84 bytes:   128000/   128000
  soc/T_74/T20_74.raw: stddev:   31.25 PSNR: 66.42 bytes:   201280/   201280
soc/T_795/T00_795.raw: stddev:   40.14 PSNR: 64.25 bytes:    90560/    90560
soc/T_795/T01_795.raw: stddev:   41.47 PSNR: 63.96 bytes:    90560/    90560
soc/T_795/T02_795.raw: stddev: 1258.16 PSNR: 34.32 bytes:   128000/   128000
soc/T_795/T03_795.raw: stddev: 1318.97 PSNR: 33.91 bytes:   128000/   128000
soc/T_795/T04_795.raw: stddev:  228.05 PSNR: 49.16 bytes:    95680/    95680
soc/T_795/T05_795.raw: stddev:   77.17 PSNR: 58.57 bytes:    71040/    71040
soc/T_795/T06_795.raw: stddev:   58.23 PSNR: 61.02 bytes:   106560/   106560
soc/T_795/T07_795.raw: stddev:   61.53 PSNR: 60.54 bytes:   115520/   115520
soc/T_795/T08_795.raw: stddev:   70.49 PSNR: 59.36 bytes:   108160/   108160
soc/T_795/T09_795.raw: stddev:   42.28 PSNR: 63.80 bytes:   129600/   129600
soc/T_795/T10_795.raw: stddev:   46.54 PSNR: 62.96 bytes:   121920/   121920
soc/T_795/T11_795.raw: stddev:  102.86 PSNR: 56.07 bytes:   116800/   116800
soc/T_795/T12_795.raw: stddev:   26.76 PSNR: 67.77 bytes:    94720/    94720
soc/T_795/T13_795.raw: stddev:   44.11 PSNR: 63.43 bytes:   107520/   107520
soc/T_795/T14_795.raw: stddev:   63.74 PSNR: 60.23 bytes:   101120/   101120
soc/T_795/T15_795.raw: stddev:   35.81 PSNR: 65.24 bytes:   104320/   104320
soc/T_795/T16_795.raw: stddev:   27.57 PSNR: 67.51 bytes:   112640/   112640
soc/T_795/T17_795.raw: stddev:   85.16 PSNR: 57.71 bytes:   100480/   100480
soc/T_795/T18_795.raw: stddev:   66.71 PSNR: 59.83 bytes:   128000/   128000
soc/T_795/T19_795.raw: stddev:   13.93 PSNR: 73.43 bytes:   128000/   128000
soc/T_795/T20_795.raw: stddev:   48.74 PSNR: 62.56 bytes:   201280/   201280
   soc/T_MODE/T21.raw: stddev:   47.04 PSNR: 62.87 bytes:   135360/   135360



More information about the ffmpeg-devel mailing list