[FFmpeg-devel] [PATCH 4/7] avcodec/golomb: Document return value of get_ue_golomb_30 on error

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Tue Jul 14 18:34:51 EEST 2020


If the return value is undefined if the value of the encountered
exp golomb code was outside the 0..30 range, said function can't
be used anywhere where one wants to check for correctness. So document
that in this case the return value is outside the range 0..30 (it
currently always returns 32 in this case).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
Btw: get_ue_golomb_30() could be used to skip exp golomb codes with
length <= 17 bits.

 libavcodec/golomb.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 172d9934e0..8b69196d44 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -135,7 +135,8 @@ static inline unsigned get_ue_golomb_long(GetBitContext *gb)
 
 /**
  * Read unsigned exp golomb code, constraint to a max of 30.
- * the return value is undefined if the stored value exceeds 30.
+ * The return value is outside the range of 0..30 if no exp golomb code
+ * in that range was encountered.
  */
 static inline int get_ue_golomb_30(GetBitContext *gb)
 {
-- 
2.20.1



More information about the ffmpeg-devel mailing list