[x264-devel] commit: fix bs_write_ue_big for values >= 0x10000. (Loren Merritt )
git version control
git at videolan.org
Fri Jul 18 04:24:45 CEST 2008
x264 | branch: master | Loren Merritt <pengvado at akuvian.org> | Thu Jul 17 20:25:03 2008 -0600| [fee2f2ce3cda8e39cc4c123afa726933b6b9b877]
fix bs_write_ue_big for values >= 0x10000.
(no immediate effect, since nothing writes such values yet)
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=fee2f2ce3cda8e39cc4c123afa726933b6b9b877
---
common/bs.h | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/common/bs.h b/common/bs.h
index 1a73690..c8edbdc 100644
--- a/common/bs.h
+++ b/common/bs.h
@@ -169,16 +169,17 @@ static inline void bs_write_ue_big( bs_t *s, unsigned int val )
int tmp = ++val;
if( tmp >= 0x10000 )
{
- bs_write32( s, 0 );
+ size = 32;
tmp >>= 16;
}
if( tmp >= 0x100 )
{
- size = 16;
+ size += 16;
tmp >>= 8;
}
size += x264_ue_size_tab[tmp];
- bs_write( s, size, val );
+ bs_write( s, size>>1, 0 );
+ bs_write( s, (size>>1)+1, val );
}
/* Only works on values under 255. */
More information about the x264-devel
mailing list