The IMC decoder uses Huffman tables which are created at runtime from
length tables of type uint8_t and code tables of type uint16_t together
with an implicit symbols table (i.e. symbol[i] == i). This commit
changes this: All three tables are subjected to the same permutation to
order the codes fro
Both the fixed as well as the floating point mpegaudio decoders use
LUTs of type int8_t and uint32_t with 32K entries each; these tables
are completely the same, yet they are not shared. This commit makes
them shared. When both fixed as well as floating point decoders are
enabled, this saves 160KiB
The csa_tables (which always consist of 32 entries of four byte each,
but the type depends upon whether the decoder is fixed or
floating-point) are currently initialized once during decoder
initialization; yet it turns out that this is actually no benefit: The
code used to initialize these tables t
Each invocation of this function is only entered once, so using a static
array makes no sense (and given that the whole array is reinitialized at
the beginning of this function, it wouldn't even make sense if the
function were called multiple times).
Signed-off-by: Andreas Rheinhardt
---
libavco
The mpegaudio_tablegen header contains code to initialize several
tables; it is included in both the fixed as well as the floating point
mpegaudio decoders and some of these tables are only used by the fixed
resp. floating point decoders; yet both types are always initialized,
leaving the compiler
Signed-off-by: Andreas Rheinhardt
---
libavcodec/Makefile | 2 +-
libavcodec/mpegaudiodata.h| 31
...pegaudiodectab.h => mpegaudiodec_common.c} | 127 ++--
libavcodec/mpegaudiodec_template.c| 137 +++---
4 f
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mpegaudiodec_template.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpegaudiodec_template.c
b/libavcodec/mpegaudiodec_template.c
index 1faaa0ae52..3fb09511bc 100644
--- a/libavcodec/mpegaudiodec_template.c
Simple now that ff_mpadsp_init() and ff_mpa_synth_init_* are thread-safe.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mpegaudiodec_fixed.c| 6 +-
libavcodec/mpegaudiodec_float.c| 6 +-
libavcodec/mpegaudiodec_template.c | 10 --
3 files changed, 14 insertions(+), 8
By switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() one
can replace tables of codes of type uint16_t by tables of symbols of
type uint8_t; this saves about 1.3KB for both the fixed and floating
point decoders (if enabled).
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mpegaud
Up until now, there were several indiviual tables which were accessed
via pointers to them; by combining the tables, one can avoid said
pointers, saving space.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mpegaudiodec_template.c | 15 +--
libavcodec/mpegaudiodectab.h | 144 +++
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mpegaudiodec_template.c | 6 +++---
libavcodec/mpegaudiodectab.h | 3 +--
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/libavcodec/mpegaudiodec_template.c
b/libavcodec/mpegaudiodec_template.c
index 53db13d0d4..88679723fc 100
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mpegaudiodec_template.c | 18 +++---
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/libavcodec/mpegaudiodec_template.c
b/libavcodec/mpegaudiodec_template.c
index 0634f70b05..53db13d0d4 100644
--- a/libavcodec/mpegaudiod
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mpegaudiodec_template.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpegaudiodec_template.c
b/libavcodec/mpegaudiodec_template.c
index 849e3e5c09..0634f70b05 100644
--- a/libavcodec/mpegaudiodec_template.c
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mv30.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c
index 1ee6be0c99..0894a4f88d 100644
--- a/libavcodec/mv30.c
+++ b/libavcodec/mv30.c
@@ -379,7 +379,7 @@ static int decode_coeffs(GetBit
By switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() one
can remove the array of codes of type uint16_t here; given that the
symbols are the default ones (0,1,2,...), no explicit symbols table
needs to be added.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mv30.c | 10 ---
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mv30.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c
index 9f28199478..5bfe4b0614 100644
--- a/libavcodec/mv30.c
+++ b/libavcodec/mv30.c
@@ -379,9 +379,6 @@ static int decode_coeffs(GetBitContext *gb, i
Signed-off-by: Andreas Rheinhardt
---
libavcodec/imm4.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/libavcodec/imm4.c b/libavcodec/imm4.c
index cee8e39773..4cbafffd9d 100644
--- a/libavcodec/imm4.c
+++ b/libavcodec/imm4.c
@@ -34,6 +34,7 @@
#include "internal.h"
By switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() one
can remove arrays of codes in cases where there were already symbols
tables.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/imm4.c | 90 ---
1 file changed, 38 insertions(+), 52
Also inline the VLC's number of bits while at it.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/imm4.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/imm4.c b/libavcodec/imm4.c
index 85d8526bc8..85046f7d06 100644
--- a/libavcodec/imm4.c
+++ b/libavcodec/imm
Using more bits than the longest code has makes no sense.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/imm4.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavcodec/imm4.c b/libavcodec/imm4.c
index d92bc30ddc..85d8526bc8 100644
--- a/libavcodec/imm4.c
+++ b/lib
This table is currently initialized up to three times: Once by the
encoder and twice by the decoders (once by the fixed and once by the
floating-point decoder); each of these initializations is guarded by an
AVOnce, yet the fact that there are three of them implies that there
might be data races (t
The header missed that these are arrays of const pointers (to const
data).
Signed-off-by: Andreas Rheinhardt
---
libavcodec/aactab.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/aactab.h b/libavcodec/aactab.h
index 7cd8128231..29df6a43f0 100644
--- a/libav
Expressions like array[get_vlc2()] can be optimized by using a symbols
table if the array is always the same for a given VLC. This requirement
is fulfilled for several VLCs used by the AAC decoders.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/aacdec_template.c | 25 +
Signed-off-by: Andreas Rheinhardt
---
libavcodec/aacdec_template.c | 32 +---
1 file changed, 13 insertions(+), 19 deletions(-)
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 76fffedfcb..473a075201 100644
--- a/libavcodec/aacdec_templat
Signed-off-by: Andreas Rheinhardt
---
libavcodec/qdmc.c | 60 ---
1 file changed, 26 insertions(+), 34 deletions(-)
diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c
index 2c870fcc1b..eca64b056e 100644
--- a/libavcodec/qdmc.c
+++ b/libavcodec/qdmc.c
@
Signed-off-by: Andreas Rheinhardt
---
libavcodec/qdmc.c | 56 ++-
1 file changed, 17 insertions(+), 39 deletions(-)
diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c
index 8b50fbf30a..2c870fcc1b 100644
--- a/libavcodec/qdmc.c
+++ b/libavcodec/qdmc.c
@
This is possible by switching to ff_init_vlc_from_lengths() which allows
to replace tables of codes of size uint16_t or uint32_t by tables of
symbols of size uint8_t; in case there already were symbols tables the
savings are even bigger.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/qdmc.c |
Signed-off-by: Andreas Rheinhardt
---
libavcodec/qdmc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c
index ff1cc86c6b..f4e507fa60 100644
--- a/libavcodec/qdmc.c
+++ b/libavcodec/qdmc.c
@@ -370,8 +370,6 @@ static int qdmc_get_vlc(GetBitContext *gb, VLC
MagicYUV transmits its Huffman trees by providing the length of the code
corresponding to each symbol; then the decoder has to assemble the table
in such a way that (i) longer codes are to the left of the tree and (ii)
for codes of the same length the symbols are ascending from left to right.
Up u
The Huffman trees used by Ut Video have two important characteristics:
(i) Longer codes are on the left of the tree and (ii) for codes of the
same length, the symbol is descending from left to right in the tree.
Therefore all the information that needs to be transmitted is how long
the code corresp
Signed-off-by: Andreas Rheinhardt
---
libavcodec/hqx.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c
index 44c6c1883c..aa4ff22a8f 100644
--- a/libavcodec/hqx.c
+++ b/libavcodec/hqx.c
@@ -122,8 +122,6 @@ static int decode_block(GetBitContext *gb, VLC *vlc
Signed-off-by: Andreas Rheinhardt
---
libavcodec/hqx.c| 4 ++--
libavcodec/hqx.h| 1 +
libavcodec/hqxvlc.c | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c
index e2b895ac40..44c6c1883c 100644
--- a/libavcodec/hqx.c
+++ b/libavcodec
Expressions like array[get_vlc2()] can be optimized by using a symbols
table if the array is always the same for a given VLC. This requirement
is fulfilled for several VLCs used by ATRAC3, therefore this commit
implements this. This comes without any additional costs when using
ff_init_vlc_from_len
In particular, don't reinitialize VLCs every time an IntraX8Context is
initialized.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/intrax8.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index b62bff3b48..0bd0db29c4 100644
-
Signed-off-by: Andreas Rheinhardt
---
libavcodec/intrax8.c | 46
1 file changed, 21 insertions(+), 25 deletions(-)
diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index 2a93e5efd7..9a2984c15b 100644
--- a/libavcodec/intrax8.c
+++ b/libavcodec
Signed-off-by: Andreas Rheinhardt
---
libavcodec/intrax8.c | 30 +-
1 file changed, 9 insertions(+), 21 deletions(-)
diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index 390c10272e..2a93e5efd7 100644
--- a/libavcodec/intrax8.c
+++ b/libavcodec/intrax8.c
@@ -
Signed-off-by: Andreas Rheinhardt
---
libavcodec/intrax8.c | 16
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index f385423dc1..390c10272e 100644
--- a/libavcodec/intrax8.c
+++ b/libavcodec/intrax8.c
@@ -46,7 +46,7 @@
theora_init_huffman_tables() does essentially the same as
ff_init_vlcs_from_lengths().
Signed-off-by: Andreas Rheinhardt
---
libavcodec/vp3.c | 21 ++---
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 2f43de757e..cf64a8c61
Expressions like array[get_vlc2()] can be optimized by using a symbols
table if the array is always the same for a given VLC. This requirement
is fulfilled for the VLC used for VP3 motion vectors. The reason it
hasn't been done before is probably that the array in this case
contained entries in the
By switching to ff_init_vlc_from_lengths() one can apply both positive
as well as negative offsets for free; in this case it even saves space
because one replaces codes tables that don't fit into an uint8_t by
symbols tables that fit into an uint8_t or can even be completely
avoided as they are tri
Signed-off-by: Andreas Rheinhardt
---
libavcodec/atrac9tab.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/atrac9tab.h b/libavcodec/atrac9tab.h
index 1882bf9f43..b169035aad 100644
--- a/libavcodec/atrac9tab.h
+++ b/libavcodec/atrac9tab.h
@@ -104,7 +104,7 @@ static
Signed-off-by: Andreas Rheinhardt
---
libavcodec/atrac9dec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c
index 6849296ac0..f0fcd0cb13 100644
--- a/libavcodec/atrac9dec.c
+++ b/libavcodec/atrac9dec.c
@@ -833,7 +833,7 @@ static
Also remove code duplication and use a named constant for the number of
VLC bits while just at it.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/atrac9dec.c | 129 +
1 file changed, 67 insertions(+), 62 deletions(-)
diff --git a/libavcodec/atrac9dec.c
Using separate tables has the downside that one needs a big number of
pointers to the separate tables (currently 77); unifying them avoids
this.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/atrac9dec.c | 19 ++-
libavcodec/atrac9tab.h | 310 ++---
2 files
Signed-off-by: Andreas Rheinhardt
---
libavcodec/atrac9dec.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c
index a1af3c22ef..ecf95f1777 100644
--- a/libavcodec/atrac9dec.c
+++ b/libavcodec/atrac9dec.c
@@ -272,7 +272,7 @@
The ATRAC9 decoder creates VLCs with parameters contained in
HuffmanCodebooks; some of these HuffmanCodebooks are empty and yet
VLCs (that were completely unused*) were created from them. Said VLC
contained a single table with 512 VLC_TYPE[2] entries, each of which
indicated that this is an invalid
The whole point of VLCs with their tables is to read more than one bit
at a time; therefore max_depth, the number of times one has to
(maximally) read further bits is given by ceil(max_code_length / table_bits)
which in the case of ATRAC9's coefficient VLCs gives an upper bound of
two. Instead the
Signed-off-by: Andreas Rheinhardt
---
libavcodec/rv34.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index e633c348bd..13f9b609e2 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -27,6 +27,7 @@
#include "libavutil/avasser
Signed-off-by: Andreas Rheinhardt
---
libavcodec/rv34.c | 68 +--
1 file changed, 30 insertions(+), 38 deletions(-)
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index 09fa962b2f..e633c348bd 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@
Using more bits for a VLC than the longest code has has no advantage.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/atrac9dec.c | 15 ++-
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c
index ecf95f1777..0477b304d2 100
Also combine two loops while at it.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/vc1.c | 29 +
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index ed31b03a8a..a4f72c1808 100644
--- a/libavcodec/vc1.c
+++ b/liba
This has been achieved by switching those VLCs that still used
ff_init_vlc_sparse() to ff_init_vlc_lengths() even though the codes
tables used uint8_t in these cases. But it allows to use one auxiliary
function to initialize the VLCs and by using tables that interleave
symbols and lengths said func
Signed-off-by: Andreas Rheinhardt
---
libavcodec/vc1.c | 32 ++--
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index c2a440d2e7..d4378cbae9 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -27,6 +27,7 @@
*
By switching to ff_init_vlc_from_lengths() from ff_init_vlc_sparse() one
can replace codes of type uint16_t by symbols of type uint8_t, saving
space.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/vc1.c | 27 +--
libavcodec/vc1data.c | 488 ---
liba
ff_vc1_norm6_spec has been removed in commit
356be9307cbffa1226bed52b26aa2ac9c7af174f (and it seems that it has never
been used).
Signed-off-by: Andreas Rheinhardt
---
libavcodec/vc1data.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h
index d376b3
Signed-off-by: Andreas Rheinhardt
---
libavcodec/vc1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 84617913ba..23a0743813 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -614,7 +614,7 @@ static void rotate_luts(VC1Context *
Expressions like array[get_vlc2()] can be optimized by using a symbols
table if the array is always the same for a given VLC. This requirement
is fulfilled for the VLCs used to parse the macroblock mode (MBMODE)
element for frame P and B pictures. MBMODE consists of four pieces of
information which
The VC1 decoder currently follows the spec very closely when decoding
MV differentials: The spec uses tables with contiguous indexes and
derives four values from it using a pseudo-code procedure: Two flags
and two values with a range of 0..5 each; the latter are obtained as the
result resp. the rem
This makes it clearer which variables are really just temporary variables
of the macro and which are actually used externally.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/vc1_block.c | 18 --
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/libavcodec/vc1_block
The VC1 decoder currently follows the spec very closely when decoding
AC coefficients: The spec uses tables with contiguous indexes. The last
of each of these is an escape code; the other codes encode three other
variables via tables: run, length and whether this is the last
coefficient.
This comm
Signed-off-by: Andreas Rheinhardt
---
libavcodec/vc1_block.c | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index 714b3cdea0..3c9d1d4b8d 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@
Signed-off-by: Andreas Rheinhardt
---
libavcodec/on2avc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c
index 64480c0701..3885f9acd7 100644
--- a/libavcodec/on2avc.c
+++ b/libavcodec/on2avc.c
@@ -169,7 +169,7 @@ static int on2avc
Also use a named constant for the number of bits of the VLC tables.
Signed-off-by: Andreas Rheinhardt
---
Now using ff_thread_once().
libavcodec/tscc2.c | 73 --
1 file changed, 32 insertions(+), 41 deletions(-)
diff --git a/libavcodec/tscc2.c b/liba
When using ff_init_vlc_sparse() to create a VLC, three input tables are
used: A table for lengths, one for codes and one for symbols; the latter
one can be omitted, then a default one will be used. These input tables
will be traversed twice, once to get the long codes (which will be put
into subtab
This is the second version of my init_vlc patchset [1]. Given the
feedback I received for the last version I stressed thread-safety of
init functions of decoders. As a consequence, the amount of decoders
with FF_CODEC_CAP_INIT_THREADSAFE increased by 25 (some of them were
already thread-safe, just
Signed-off-by: Andreas Rheinhardt
---
libavcodec/msmpeg4dec.c | 5 -
libavcodec/vc1_block.c | 12
2 files changed, 17 deletions(-)
diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index 49df06a9d7..b3964457d6 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/
The VC1 decoder currently follows the spec very closely when decoding
interlaced MV vector variable-length codes: The spec uses tables with
contiguous indexes. The last of these is an escape code, for every other
two values are encoded via (index + 1) / 9 and (index + 1) % 9. The
decoder did exactl
Expressions like array[get_vlc2()] can be optimized by using a symbols
table if the array is always the same for a given VLC. This requirement
is fulfilled for the VLC for the Block-level Transform Type and
therefore this commit implements this; switching from
ff_init_vlc_sparse() to ff_init_vlc_fr
Offseting by +1 is possible without adding dummy elements to the
beginning of the codes and lengths tables by switching to
ff_init_vlc_from_lengths() as this allows one to set the symbols
arbitrarily without incurring any penalty.
Signed-off-by: Andreas Rheinhardt
---
All the VC1 patches have imp
This allows to remove lots of pointers (130) to small symbol tables;
it has the downside that some of the default tables must now be coded
explicitly, but this costs only 6 + 4 + 8 + 16 + 8 bytes and is therefore
dwarfed by the gains.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/atrac3plus.c
This is very beneficial for the scale factor tables where 4*64+4*15
bytes of length information can be replaced by eight codebooks of 12
bytes each; furthermore the number of codes as well as the maximum
length of a code can be easily derived from said codebooks, making
tables containing said infor
ATRAC3+ uses VLCs whose code lengths are ascending from left to right in
the tree; ergo it is possible (and done) to run-length encode the
lengths into so-called codebooks. These codebooks were variable-sized:
The first byte contained the minimum length of a code, the second the
maximum length; thi
The earlier code used several different offset parameters that were
initialized to magic values. This is unnecessary.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/atrac3plus.c | 25 ++---
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/libavcodec/atrac3plu
The ATRAC3+ decoder currently uses ff_init_vlc_sparse() to initialize
several VLCs; sometimes a symbols table is used, sometimes not; some of
the codes tables are uint16_t, some are uint8_t. Because of these two
latter facts it makes sense to switch to ff_init_vlc_from_lengths()
because it allows t
Use ff_init_vlc_from_lengths() to offload the computation of the codes.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/atrac3plus.c | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/libavcodec/atrac3plus.c b/libavcodec/atrac3plus.c
index 6b046a887e..f527d3b9fc 100644
Signed-off-by: Andreas Rheinhardt
---
libavcodec/truemotion2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index d6375ad489..012ad4ffde 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -1018,5 +1018
ff_init_vlc_from_lengths() can be used to offload the computation
of the codes; it also allows to omit the check whether the codes
are already properly ordered (they are). In this case, this also allows
to avoid the allocation of the buffer for the codes.
This improves performance: The amount of d
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mpeg4video.h| 4 --
libavcodec/mpeg4videodec.c | 88 --
2 files changed, 36 insertions(+), 56 deletions(-)
diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h
index 3de598465f..e919db87a5 100644
Switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths()
allows to replace codes which are so long that they need to be stored
in an uint16_t by symbols which fit into an uint8_t; and even these can
be avoided in case of the sprite trajectory VLC.
Signed-off-by: Andreas Rheinhardt
---
l
Signed-off-by: Andreas Rheinhardt
---
libavcodec/indeo2.c | 14 +++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index 5a9c0e77be..5721308267 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -25,6 +25,7 @@
*/
Switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths()
allows to replace codes which are so long that they need to be stored
in an uint16_t by symbols which fit into an uint8_t; furthermore, it is
also easily possible to already incorporate the offset (the real range
of Indeo 2 symbols s
ff_init_vlc_from_lengths() can be used to offload the computation
of the codes; it also allows to omit the check whether the codes
are already properly ordered (they are).
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mjpegdec.c | 23 +--
1 file changed, 9 insertions(+), 1
The longest AC codes of the standard JPEG tables are 16 bits long; for
the DC tables, the maximum is 11, so using max_depth of two is
sufficient.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/g2meet.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/g2meet.c
ff_init_vlc_from_lengths() can be used to offload the computation
of the codes; it also needn't check whether the codes are already
properly ordered (they are).
Signed-off-by: Andreas Rheinhardt
---
libavcodec/sheervideo.c | 13 -
1 file changed, 4 insertions(+), 9 deletions(-)
diff
It is an init function even when called from decode_frame().
Signed-off-by: Andreas Rheinhardt
---
libavcodec/sheervideo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/sheervideo.c b/libavcodec/sheervideo.c
index 976c21c445..3e60ef26a5 100644
--- a/libavcodec/sh
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mss4.c | 74 +++
1 file changed, 30 insertions(+), 44 deletions(-)
diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c
index f8edaac4cd..7f11f30dc8 100644
--- a/libavcodec/mss4.c
+++ b/libavcodec/mss4.c
@
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mss4.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c
index 74132fd7c1..f8edaac4cd 100644
--- a/libavcodec/mss4.c
+++ b/libavcodec/mss4.c
@@ -628,5 +628,5 @@ AVCodec ff_mts2_decoder = {
Signed-off-by: Andreas Rheinhardt
---
configure | 2 +-
libavcodec/mss4.c | 58 +--
2 files changed, 7 insertions(+), 53 deletions(-)
diff --git a/configure b/configure
index 51e43fbf66..10cf61007b 100755
--- a/configure
+++ b/configure
@@ -28
The lengths of the codes used by the mss4 decoder are ascending from
left to right and therefore the lengths can be run-length encoded and
the codes can be easily derived from them. And this is how it is indeed
done. Yet some things can nevertheless be improved:
a) The number of entries of the cur
Besides removing code duplication the method for determining the offset
of each VLC table in the VLC_TYPE buffer also has the advantage of not
wasting space for skipped AIC mode 1 VLCs.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/rv40.c | 52 +++---
libavcodec/rv40vlc2.h | 383
RealVideo 4.0 has a VLC that encodes two intra types per code; each
intra type is in the range 0..8 (inclusive) and up until now the VLC
used symbols in the range 0..80; one type was encoded as the remainder
when dividing the symbol by 9 whereas the other type was encoded as
symbol / 9. This is sub
Signed-off-by: Andreas Rheinhardt
---
libavcodec/rv40.c | 14 +-
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c
index 6f9f2c5665..b1c434d8f4 100644
--- a/libavcodec/rv40.c
+++ b/libavcodec/rv40.c
@@ -41,11 +41,6 @@ static VLC aic_to
After permuting the codes, symbols and lengths tables used to initialize
the VLC so that the codes are ordered from left to right in the Huffman
tree, the codes become redundant as they can be easily computed from the
lengths at runtime; in this case one has to use explicit symbol tables,
but all t
Signed-off-by: Andreas Rheinhardt
---
libavcodec/rv40vlc2.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/rv40vlc2.h b/libavcodec/rv40vlc2.h
index 15119a145b..4cdc7a4193 100644
--- a/libavcodec/rv40vlc2.h
+++ b/libavcodec/rv40vlc2.h
@@ -33,7 +33,7 @@
* codes use
Forgotten in f054e309c58894450a5d18cce9799ef58aab9f14.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/qdm2.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index b1465750c2..fbc4c0cfdd 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1595,8
Signed-off-by: Andreas Rheinhardt
---
libavcodec/qdm2.c | 14 +-
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index f2e78c3fa2..b1465750c2 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -36,6 +36,7 @@
#include
#inc
Signed-off-by: Andreas Rheinhardt
---
libavcodec/qdm2_tablegen.h | 42 ++
1 file changed, 20 insertions(+), 22 deletions(-)
diff --git a/libavcodec/qdm2_tablegen.h b/libavcodec/qdm2_tablegen.h
index 2ae8449c14..ca47fea2dc 100644
--- a/libavcodec/qdm2_tablegen.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/qdm2_tablegen.h | 12 +++-
libavcodec/qdm2data.h | 28 ++--
2 files changed, 17 insertions(+), 23 deletions(-)
diff --git a/libavcodec/qdm2_tablegen.h b/libavcodec/qdm2_tablegen.h
index e948e92295..2ae8449c14 1
Signed-off-by: Andreas Rheinhardt
---
libavcodec/qdm2.c | 2 +-
libavcodec/qdm2_tablegen.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index bd365739ce..f2e78c3fa2 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -
After permuting the codes, symbols and lengths tables used to initialize
the VLCs so that the codes are ordered from left to right in the Huffman
tree, the codes become redundant as they can be easily computed from the
lengths at runtime (or at compile time with --enable-hardcoded-tables);
in this
1 - 100 of 193 matches
Mail list logo