aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-09-22 15:18:17 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-10-23 01:44:41 +0200
commit4b14c3ed7857e386ae49bd6f1c4124e52d1667f3 (patch)
tree9b3e31d1dc984f9d3cd0579378582da32cbed16c
parent9b95c4740d23d69e6693f974ab954c50957e4c4e (diff)
downloadffmpeg-4b14c3ed7857e386ae49bd6f1c4124e52d1667f3.tar.gz
avcodec/unary: Improve get_unary() docs
Found-by: kierank Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ad89e203bfedf25df00e2a6ed9196170d772f25b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/unary.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/libavcodec/unary.h b/libavcodec/unary.h
index 908dc93507..d57f9f70c5 100644
--- a/libavcodec/unary.h
+++ b/libavcodec/unary.h
@@ -28,7 +28,20 @@
* @param gb GetBitContext
* @param[in] stop The bitstop value (unary code of 1's or 0's)
* @param[in] len Maximum length
- * @return Unary length/index
+ * @return unary 0 based code index. This is also the length in bits of the
+ * code excluding the stop bit.
+ * (in case len=1)
+ * 1 0
+ * 0 1
+ * (in case len=2)
+ * 1 0
+ * 01 1
+ * 00 2
+ * (in case len=3)
+ * 1 0
+ * 01 1
+ * 001 2
+ * 000 3
*/
static inline int get_unary(GetBitContext *gb, int stop, int len)
{