Luca Barbato
19c5fa9eea
golomb: Simplify get_ur_golomb_jpegls
...
The loop always consumes the bit read and the new bitstream reader
can read 0 bits just fine.
2017-04-13 13:37:10 +02:00
Diego Biurrun
d4c2103bd3
golomb: Convert to the new bitstream reader
2017-01-31 17:46:19 +01:00
Diego Biurrun
f7407f56cb
golomb: Replace __PRETTY_FUNCTION__ with __func__ for tracing
...
The former is a GNU extension while the latter is C99.
2016-11-15 09:41:08 +01:00
Diego Biurrun
83b92a855e
golomb: Drop disabled cruft
2016-08-17 12:22:29 +02:00
Diego Biurrun
4024b566d6
golomb: Give svq3_get_se_golomb()/svq3_get_ue_golomb() better names
2016-05-25 16:37:43 +02:00
Diego Biurrun
52567e8198
get_bits: Drop some TRACE-level debug code
...
It will not be provided by the new bit reader anyway.
2016-05-22 20:22:43 +02:00
Diego Biurrun
91d305790e
get_bits: Rename HAVE_BITS_REMAINING --> BITS_AVAILABLE
...
The HAVE_ prefix is reserved for macros set by configure.
2014-09-02 13:10:38 +02:00
Martin Storsjö
508a84e672
golomb: Fix the implementation of get_se_golomb_long
...
This was only used in hevc muxing code so far.
This makes the return values match what get_se_golomb returns for
the same bitstream reader instances.
The logic for producing a signed golomb code out of an unsigned one
was based on the corresponding code in get_se_golomb, which operated
directly on the bitstream reader buffer - not on the equivalent
return value from get_ue_golomb.
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-03-30 00:28:27 +02:00
Luca Barbato
5eacbb5328
golomb: Add a get_se_golomb_long
...
Useful in libavformat mostly.
2014-03-10 10:58:37 +01:00
Vittorio Giovara
fb13fe8342
golomb: reduce scope of a few variables
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-10-24 02:04:34 +02:00
Vittorio Giovara
2c993e8b5e
golomb: K&R formatting cosmetics
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-10-23 13:17:23 +02:00
Janne Grunau
9a2e79116d
golomb: use unsigned arithmetics in svq3_get_ue_golomb()
...
This prevents undefined behaviour of signed left shift if the coded
value is larger than 2^31. Large values are most likely invalid and
caused errors or by feeding random.
Validate every use of svq3_get_ue_golomb() and changed the place there
the return value was compared with negative numbers. dirac.c was clean,
fixed rv30 and svq3.
2012-12-08 12:55:10 +01:00
Diego Biurrun
6f6b0311a3
avcodec: Drop some silly commented-out av_log() invocations
2012-10-01 10:24:28 +02:00
Diego Biurrun
80412997c8
golomb: const correctness for get_ue()/get_se() function arguments
2012-09-27 19:10:10 +02:00
Justin Ruggles
4795362660
golomb: check remaining bits during unary decoding in get_ur_golomb_jpegls()
...
Fixes infinite loop in FLAC decoding in case of a truncated bitstream due to
the safe bitstream reader returning 0's at the end.
Fixes Bug 310.
CC:libav-stable@libav.org
2012-06-12 14:33:39 -04:00
Ronald S. Bultje
46b3fbc30b
golomb: use HAVE_BITS_REMAINING() macro to prevent infloop on EOF.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-24 07:28:33 -08:00
Ronald S. Bultje
52e4018be4
flac: fix infinite loops on all-zero input or end-of-stream.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-16 17:08:29 -08:00
Ronald S. Bultje
c6643fddba
golomb: avoid infinite loop on all-zero input (or end of buffer).
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-16 08:36:08 -08:00
Mans Rullgard
fdba370f8a
h264: fix HRD parameters parsing
...
The bit_rate_value_minus1 and cpb_size_value_minus1 elements
allow a wider range than get_ue_golomb() supports. This
adds a get_ue_golomb_long() function supporting up to 31
leading zeros, which is the maximum for these syntax
elements, and uses it in decode_hrd_parameters().
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-10-11 18:24:51 +01:00
Mans Rullgard
2912e87a6c
Replace FFmpeg with Libav in licence headers
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Diego Biurrun
ba87f0801d
Remove explicit filename from Doxygen @file commands.
...
Passing an explicit filename to this command is only necessary if the
documentation in the @file block refers to a file different from the
one the block resides in.
Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-20 14:45:34 +00:00
Lars Täuber
6fa6c481b9
Make get_ur_golomb capable of reading 16 bit values.
...
Patch by Lars Täuber: firstname taeuber gmx net
Originally committed as revision 19821 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-11 06:25:36 +00:00
Stefano Sabatini
9106a698e7
Rename bitstream.h to get_bits.h.
...
Originally committed as revision 18494 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-04-13 16:20:26 +00:00
Stefano Sabatini
b275500706
Split bitstream.h, put the bitstream writer stuff in the new file
...
put_bits.h.
Originally committed as revision 18461 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-04-12 08:35:26 +00:00
Måns Rullgård
d4f2a6250a
Fix get_ur_golomb_jpegls() with A32_BITSTREAM_READER
...
If k==0, log==0 can indicate that the coded value uses more than
MIN_CACHE_BITS bits. With MIN_CACHE_BITS==32, the fast branch is
incorrectly taken in this case unless explicitly forbidden.
Originally committed as revision 17550 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-24 01:41:44 +00:00
Michael Niedermayer
9392863d1b
Clarify get_ue_golomb_31() behavior with >31.
...
Originally committed as revision 17429 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-18 11:57:11 +00:00
Diego Biurrun
bad5537e2c
Use full internal pathname in doxygen @file directives.
...
Otherwise doxygen complains about ambiguous filenames when files exist
under the same name in different subdirectories.
Originally committed as revision 16912 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-01 02:00:19 +00:00
Michael Niedermayer
0e921e97c1
Add get_ue_golomb_31()
...
Originally committed as revision 16298 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-23 21:05:47 +00:00
Michael Niedermayer
740c14dbd7
Fix regression test failure caused by golomb limit not being considered
...
in r15334.
Originally committed as revision 15338 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-09-16 01:24:12 +00:00
Michael Niedermayer
631e8afb8c
Correct the threshold of get_ur_golomb_jpegls() at which the optimized
...
case is used.
Fix issue245.
Originally committed as revision 15334 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-09-15 20:30:22 +00:00
Stefano Sabatini
987903826b
Globally rename the header inclusion guard names.
...
Consistently apply this rule: the guard name is obtained from the
filename by stripping the leading "lib", converting '/' and '.' to
'_' and uppercasing the resulting name. Guard names in the root
directory have to be prefixed by "FFMPEG_".
Originally committed as revision 15120 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-08-31 07:39:47 +00:00
Ramiro Polla
6647ab80e3
bitstream: move put_sbits() from flacenc.c to bitstream.h and use it
...
throughout libavcodec.
Originally committed as revision 14204 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-07-13 14:27:48 +00:00
Diego Biurrun
5b21bdabe4
Add FFMPEG_ prefix to all multiple inclusion guards.
...
Originally committed as revision 10765 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-10-17 09:37:46 +00:00
Marco Gerards
9df4ce5e5b
Make the Golomb decoder work for Dirac
...
Originally committed as revision 10119 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-08-15 12:59:27 +00:00
Diego Biurrun
e5a389a1b7
license header consistency cosmetics
...
Originally committed as revision 9484 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-07-05 10:40:25 +00:00
Guillaume Poirier
efb775777f
add a comment to indicate which #endif belong to which #define
...
Originally committed as revision 9356 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-06-17 18:59:28 +00:00
Måns Rullgård
699b3f99d0
add multiple inclusion guards to headers
...
Originally committed as revision 9345 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-06-17 00:01:30 +00:00
Måns Rullgård
99545457bf
include all prerequisites in header files
...
Originally committed as revision 9344 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-06-16 22:59:13 +00:00
Kostya Shishkov
76aca7a8bf
handle limit>32 for set_ur_golomb_jpegls()
...
Originally committed as revision 6754 to svn://svn.ffmpeg.org/ffmpeg/trunk
2006-10-22 04:52:15 +00:00
Diego Biurrun
b78e7197a8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
...
and fix GPL/LGPL version mismatches.
Originally committed as revision 6577 to svn://svn.ffmpeg.org/ffmpeg/trunk
2006-10-07 15:30:46 +00:00
Michael Niedermayer
9e96ab0389
first rudimentary version of (Justin Ruggles jruggle earthlink net) flac encoder
...
Originally committed as revision 5514 to svn://svn.ffmpeg.org/ffmpeg/trunk
2006-06-24 10:20:15 +00:00
Diego Biurrun
5509bffa88
Update licensing information: The FSF changed postal address.
...
Originally committed as revision 4842 to svn://svn.ffmpeg.org/ffmpeg/trunk
2006-01-12 22:43:26 +00:00
Diego Biurrun
bb270c0896
COSMETICS: tabs --> spaces, some prettyprinting
...
Originally committed as revision 4764 to svn://svn.ffmpeg.org/ffmpeg/trunk
2005-12-22 01:10:11 +00:00
Diego Biurrun
115329f160
COSMETICS: Remove all trailing whitespace.
...
Originally committed as revision 4749 to svn://svn.ffmpeg.org/ffmpeg/trunk
2005-12-17 18:14:38 +00:00
Alex Beregszaszi
e134e10f37
set_se_golomb can only write 16bits, add a note about this (ok, maybe it's brain dead using it with more than 16bits, but..)
...
Originally committed as revision 4635 to svn://svn.ffmpeg.org/ffmpeg/trunk
2005-10-12 22:43:12 +00:00
Michael Niedermayer
85ad569574
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
...
Originally committed as revision 3984 to svn://svn.ffmpeg.org/ffmpeg/trunk
2005-02-26 03:36:04 +00:00
Michael Niedermayer
895345da9a
svq3_get_se_golomb() fix
...
Originally committed as revision 3849 to svn://svn.ffmpeg.org/ffmpeg/trunk
2005-01-19 13:03:38 +00:00
Loïc Le Loarer
61f040dd1a
compile with TRACE define patch by (Loic <lll+ffmpeg m4x org>)
...
Originally committed as revision 3848 to svn://svn.ffmpeg.org/ffmpeg/trunk
2005-01-19 12:58:34 +00:00
Michael Niedermayer
a6c01275ad
get/set_sr_golomb() cleanup
...
Originally committed as revision 3451 to svn://svn.ffmpeg.org/ffmpeg/trunk
2004-09-10 19:40:55 +00:00
Alex Beregszaszi
4579adb00c
new signed golomb routines
...
Originally committed as revision 3444 to svn://svn.ffmpeg.org/ffmpeg/trunk
2004-09-08 17:59:22 +00:00