# HG changeset patch # User conrad # Date 1266711051 0 # Node ID 386c361bf1361540d3d7ad2b8b6b0ff77ebcc655 # Parent 5811a86f55f1d0465176ee8286b7122629bc90be Make the special 4129 case for long-run bit strings a #define and explain it diff -r 5811a86f55f1 -r 386c361bf136 vp3.c --- a/vp3.c Sun Feb 21 00:10:47 2010 +0000 +++ b/vp3.c Sun Feb 21 00:10:51 2010 +0000 @@ -63,6 +63,11 @@ #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 @@ } } - if (run_length == 4129) + if (run_length == MAXIMUM_LONG_BIT_RUN) bit = get_bits1(gb); else bit ^= 1;