Found-by: kierank
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ad89e203bfedf25df00e2a6ed9196170d772f25b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
... | ... |
@@ -28,7 +28,20 @@ |
28 | 28 |
* @param gb GetBitContext |
29 | 29 |
* @param[in] stop The bitstop value (unary code of 1's or 0's) |
30 | 30 |
* @param[in] len Maximum length |
31 |
- * @return Unary length/index |
|
31 |
+ * @return unary 0 based code index. This is also the length in bits of the |
|
32 |
+ * code excluding the stop bit. |
|
33 |
+ * (in case len=1) |
|
34 |
+ * 1 0 |
|
35 |
+ * 0 1 |
|
36 |
+ * (in case len=2) |
|
37 |
+ * 1 0 |
|
38 |
+ * 01 1 |
|
39 |
+ * 00 2 |
|
40 |
+ * (in case len=3) |
|
41 |
+ * 1 0 |
|
42 |
+ * 01 1 |
|
43 |
+ * 001 2 |
|
44 |
+ * 000 3 |
|
32 | 45 |
*/ |
33 | 46 |
static inline int get_unary(GetBitContext *gb, int stop, int len) |
34 | 47 |
{ |