summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideodec.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-01-27 19:06:36 +0100
committerAnton Khirnov <anton@khirnov.net>2022-07-04 18:16:11 +0200
commitc9a2506de9e906e82c4c99df759fcfc1142b24a4 (patch)
treebc36abbb44313265f5670f23a3861d3f136082db /libavcodec/mpegvideodec.h
parent8cfb44cd2ec76306f0c4fbfd030b411f77298074 (diff)
get_bits: move check_marker() to mpegvideodec.h
It is only used by mpegvideo-based decoders - specifically mpeg12, intelh263, ituh263, mpeg4video.
Diffstat (limited to 'libavcodec/mpegvideodec.h')
-rw-r--r--libavcodec/mpegvideodec.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/mpegvideodec.h b/libavcodec/mpegvideodec.h
index 1af8ebac36..fabc1b2202 100644
--- a/libavcodec/mpegvideodec.h
+++ b/libavcodec/mpegvideodec.h
@@ -29,6 +29,8 @@
#define AVCODEC_MPEGVIDEODEC_H
#include "libavutil/frame.h"
+#include "libavutil/log.h"
+
#include "avcodec.h"
#include "get_bits.h"
#include "mpegpicture.h"
@@ -67,4 +69,14 @@ static inline int mpeg_get_qscale(MpegEncContext *s)
return qscale << 1;
}
+static inline int check_marker(void *logctx, GetBitContext *s, const char *msg)
+{
+ int bit = get_bits1(s);
+ if (!bit)
+ av_log(logctx, AV_LOG_INFO, "Marker bit missing at %d of %d %s\n",
+ get_bits_count(s) - 1, s->size_in_bits, msg);
+
+ return bit;
+}
+
#endif /* AVCODEC_MPEGVIDEODEC_H */