summaryrefslogtreecommitdiff
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2010-02-21 00:10:51 +0000
committerDavid Conrad <lessen42@gmail.com>2010-02-21 00:10:51 +0000
commitecb51b25bb3511f3e251d7a3ead653eda9a9179d (patch)
treee425a71ee3637226777c39cb1630327e30937ef8 /libavcodec/vp3.c
parent33dbc1b7ca4bf8679079e1fede69dde92abf4d19 (diff)
Make the special 4129 case for long-run bit strings a #define and explain it
Originally committed as revision 21928 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 9268d5e7af..e669332740 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -63,6 +63,11 @@ typedef struct Vp3Fragment {
#define SB_PARTIALLY_CODED 1
#define SB_FULLY_CODED 2
+// This is the maximum length of a single long bit run that can be encoded
+// for superblock coding or block qps. Theora special-cases this to read a
+// bit instead of flipping the current bit to allow for runs longer than 4129.
+#define MAXIMUM_LONG_BIT_RUN 4129
+
#define MODE_INTER_NO_MV 0
#define MODE_INTRA 1
#define MODE_INTER_PLUS_MV 2
@@ -920,7 +925,7 @@ static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb)
}
}
- if (run_length == 4129)
+ if (run_length == MAXIMUM_LONG_BIT_RUN)
bit = get_bits1(gb);
else
bit ^= 1;