---
yuv2yuvX.asm: Ports yuv2yuvX to asm, unrolls main loop and adds
other small optimizations for ~20% speed-up. Copyright updated to
include the original from swscale.c
swscale.c: Removes yuv2yuvX_sse3 and calls new function ff_yuv2yuvX_sse3.
Calls yuv2yuvX_mmxext on remainining elements if r
I tried to build libffmpeg.so with h264 and h265 codec so go to compile
as on: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
but cannot find the exact explanation of this dynamic link build as all refer
tostandalone executable build
How is actually the definitive way to compile/build libff
Budi (12020-11-10):
> I tried to build libffmpeg.so with h264 and h265 codec so go to compile
> as on: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
>
> but cannot find the exact explanation of this dynamic link build as all refer
> tostandalone executable build
> How is actually the defin
This patchset provides an alternative to ff_init_vlc_sparse() to
initialize VLCs: ff_init_vlc_from_lengths(). It is based upon the
observation that the codes of a complete VLC can be easily computed
from the lengths if the lengths are ordered according to "left elements
in the tree first". This ena
Also use a named constant for the number of bits of the VLC tables.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/tscc2.c | 73 --
1 file changed, 32 insertions(+), 41 deletions(-)
diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c
index 7a591899
After permuting both the codes, lengths and symbols tables so that
the codes tables are ordered from left to right in the tree, the codes
tables can be easily computed from the lengths tables at runtime and
therefore omitted. This saves about 2KB from the binary.
Signed-off-by: Andreas Rheinhardt
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
One can offload the computation of the codes to
ff_init_vlc_from_lengths(); this also improves performance: The number
of decicycles for one call to read_code_table() decreased from 198343
to 148338 with the sample sample-cllc-rgb.avi from the FATE suite; it
has been looped 100 times and the test r
The Smacker Huffman tables are already stored in a tree-like structure;
in particular, they are naturally ordered from left to right in the
tree and are therefore suitable to be initialized by
ff_init_vlc_from_lengths() which avoids traversing the data twice in
order to sort only the codes that are
Using one big table for the symbols and lengths makes it
possible to remove the pointers to the individual tables.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/tscc2.c | 8 ++-
libavcodec/tscc2data.h | 116 ++---
2 files changed, 34 insertions(+), 90
Right now the allocated size of the VLC table of a static VLC has to
exactly match the size actually used for the VLC: If it is not enough,
abort is called; if it is more than enough, an error message is
emitted. This is no problem when one wants to initialize an individual
VLC via one of the INIT_
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 54afe8b13a..c79d3d64fb 100644
--- a/libavcodec/on2avc.c
+++ b/libavcodec/on2avc.c
@@ -169,7 +169,7 @@ static int on2avc
Using one big table for the codebook symbols and lengths makes it
possible to remove the pointers to the individual tables.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/on2avc.c | 8 ++-
libavcodec/on2avcdata.c | 132 ++--
libavcodec/on2avcdata.h |
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
Signed-off-by: Andreas Rheinhardt
---
libavcodec/imc.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index 19a323e17d..a9e8a9c7e3 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -113,11 +113,6 @@ static VLC huffman_vlc
Signed-off-by: Andreas Rheinhardt
---
libavcodec/clearvideo.c | 202 +++-
libavcodec/clearvideodata.h | 104 ++-
2 files changed, 90 insertions(+), 216 deletions(-)
diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index fd11d88b7a
After the motion vector and bias values tables have been reordered so
that the codes are ordered from left to right, it emerged that the
length of these entries are actually ascending for every table.
Therefore it is possible to encode them in a run-length style and create
the actual length tables
Signed-off-by: Andreas Rheinhardt
---
libavcodec/clearvideo.c | 21 -
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index 162dc13ce7..dd5720bda4 100644
--- a/libavcodec/clearvideo.c
+++ b/libavcodec/clearvideo.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/clearvideo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index dd5720bda4..1d88a9a776 100644
--- a/libavcodec/clearvideo.c
+++ b/libavcodec/clearvideo.c
@@ -371,7 +371,7 @@ s
Signed-off-by: Andreas Rheinhardt
---
libavcodec/clearvideo.c | 7 +++--
libavcodec/clearvideodata.h | 54 ++---
2 files changed, 23 insertions(+), 38 deletions(-)
diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index 1d88a9a776..9b4f03d15e 100
This is possible by switching to ff_init_vlc_from_lengths() which allows
to replace the table for the codes (which need an uint16_t) by a table
of symbols which fit into an uint8_t. Also switch to an ordinary
INIT_VLC macro while just at it.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/wnv1.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/wnv1.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c
index f8a9b94746..7dd0e72596 100644
--- a/libavcodec/wnv1.c
+++ b/libavcodec/wnv1.c
@@ -43,10 +43,10 @@ static inline int wnv1_ge
Signed-off-by: Andreas Rheinhardt
---
libavcodec/clearvideo.c | 94 ++---
1 file changed, 40 insertions(+), 54 deletions(-)
diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index 9b4f03d15e..33b94bb086 100644
--- a/libavcodec/clearvideo.c
+++ b/l
Signed-off-by: Andreas Rheinhardt
---
libavcodec/cook.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 7b24868f57..9f44df5332 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -200,7 +200,7 @@ static av_cold int init_coo
Up until now, the Cook decoder used tables for the lengths of codes and
tables of the codes itself to initialize VLCs; the tables for the codes
were of type uint16_t because the codes were so long. It did not use
explicit symbol tables. This commit instead reorders the tables so that
the code table
Signed-off-by: Andreas Rheinhardt
---
libavcodec/cook.c | 11 +++
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 75422d18aa..0fa42d681d 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -65,6 +65,9 @@
#define SUBBAND_SIZE
This can be achieved by switching to ff_init_vlc_from_lengths() which
allows to replace two uint16_t tables for codes with uint8_t tables for
the symbols by permuting the tables so that the codes are ordered from
left to right in the tree in which case they can be easily computed from
the lengths a
Permuting the tables used to initialize the Cook VLCs so that the code
tables are ordered from left to right in the tree revealed that the
length of the codes are ascending from left to right. Therefore one can
run-length encode them to avoid the big length tables; this saves a bit
more than 1KB.
These tables were huge (14 bits) because one needed 14 bits in order to
find out whether a code is valid and in the VLC table or a valid code that
required hacky workarounds due to RealVideo 1.0 using multiple codes
for the same symbol and the code predating the introduction of symbols
tables for V
RealVideo 1.0 uses an insane way to encode DC coefficients: There are
several symbols that (for no good reason whatsoever) have multiple
encodings, leading to longer codes than necessary.
More specifically, the tree for the 256 luma symbols contains 255 codes
belonging to 255 different symbols on
The VLC tables to be used for parsing RealVideo 1.0 DC coefficients are
weird: The luma table contains a block of 2^11 codes beginning with the
same prefix and length that all have the same symbol (i.e. value only
depends upon the prefix); the same goes for the chroma block (except
it's only 2^9 co
By switching to ff_init_vlc_from_lengths() one can replace a table of
codes of type uint32_t with a table of symbols of type uint8_t saving
space. The old tables also had holes in it (because of the symbols) which
are now superfluous, saving ever more space.
Signed-off-by: Andreas Rheinhardt
---
The RealVideo 1.0 decoder uses VLCs to parse DC coefficients. But the
values returned from get_vlc2() are not directly used; instead
-(val - 128) (which is in the range -127..128) is. This transformation
is unnecessary as it can effectively be done when initializing the VLC
by modifying the symbols
If the Huffman tree consists of only one entry (which has length zero),
no tree is used at all for parsing as the VLC API currently can't handle
this. So it makes no sense to create a VLC in this case.
Commit 41b7389cade702383e59343561776f83bb26e17f added a check for
whether creating the VLC shoul
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mimic.c | 18 +++---
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c
index 32f02d4b61..3e4d7c2576 100644
--- a/libavcodec/mimic.c
+++ b/libavcodec/mimic.c
@@ -58,13 +58,14 @@ typede
The algorithm used here always creates a complete VLC, so it is
unnecessary to check this again.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/motionpixels.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index 4b9830fbed..a65250efe5
This ensures that the number of leafs in the Huffman tree equals the
number it is supposed to be and therefore ensures that the VLC tree is
complete, allowing us to remove checks.
Signed-off-by: Andreas Rheinhardt
---
Alternatively one could use mp->current_codes_count when initializing
the VLC.
By switching to ff_init_vlc_from_lengths() one can replace tables of
codes of type uint16_t with tables of symbols of type uint8_t, saving
space.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mpc7.c | 27
libavcodec/mpc7data.h | 156 --
2
By using ff_init_vlc_from_lengths(), we do not have to keep track of the
codes themselves, but can offload this to ff_init_vlc_from_lengths().
Furthermore, the old code presumed sizeof(int) == 4; this is no longer
so.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/motionpixels.c | 19
If allows us to directly store the deltas in the VLC table and therefore
avoids a level of indirection.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/motionpixels.c | 17 ++---
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/libavcodec/motionpixels.c b/libavcodec/mo
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mpc8.c | 21 +
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
index 339ee515b8..31b7ad14ac 100644
--- a/libavcodec/mpc8.c
+++ b/libavcodec/mpc8.c
@@ -39,9 +39,6 @@
static VL
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mpc7.c | 17 +
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c
index 3c1a8578dd..7f6a01d444 100644
--- a/libavcodec/mpc7.c
+++ b/libavcodec/mpc7.c
@@ -38,22 +38,15 @@
static VL
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mpc7.c | 12 ++--
libavcodec/mpc7data.h | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c
index 532ea113c2..3c1a8578dd 100644
--- a/libavcodec/mpc7.c
+++ b/libavcodec/mpc7.c
By switching to ff_init_vlc_from_lengths() one can make a table of
codes of type uint8_t superfluous, saving space.
Other VLCs (for which there was no dedicated symbols table and where the
codes where already of type uint8_t) have been made to use
ff_init_vlc_from_lengths(), too, because it reduce
After permuting both length, code as well as symbol tables so that
the codes are ordered from left to right in the tree, it became apparent
that the length of the codes decreases from left to right. Therefore one
can run-length encode the lengths to save space. This commit implements
this.
Signed-
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
Signed-off-by: Andreas Rheinhardt
---
libavcodec/qdm2_tablegen.h | 159 +++--
1 file changed, 27 insertions(+), 132 deletions(-)
diff --git a/libavcodec/qdm2_tablegen.h b/libavcodec/qdm2_tablegen.h
index 309bb4b53c..0e57902fc9 100644
--- a/libavcodec/qdm2_tablegen
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mobiclip.c | 132 +-
1 file changed, 66 insertions(+), 66 deletions(-)
diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c
index e4a2594954..2d3225f464 100644
--- a/libavcodec/mobiclip.c
+++ b/libavco
Several of the quantisation VLCs come in pairs and up until now the
number of bits used for each VLC was set to the same value for both VLCs
in such a pair even when one of the two required only a lower number.
This is a waste given that the get_vlc2() call is compatible with these
two VLCs using a
Up until now, VLCs that were part of an array of VLCs were often not
initialized in a loop, but separately. The probable reason for this
was that these VLCs differed slightly in the parameters to be used for
them (i.e. the number of codes or the number of bits to be used
differs), so that one would
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 aaa7356caf..b60989e343 1
If both codes, lengths and symbols tables are ordered so that the codes
are sorted from left to right in the tree, the codes can be easily
derived from the lengths and therefore become redundant. This is
exploited in this commit to remove the codes tables for the mobiclip
decoder; notice that table
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 657b2da64d..bdfe710840 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mobiclip.c | 106 --
1 file changed, 51 insertions(+), 55 deletions(-)
diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c
index cb17832898..e4a2594954 100644
--- a/libavcodec/mobiclip.c
+++ b/libavco
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
Signed-off-by: Andreas Rheinhardt
---
libavcodec/qdm2_tablegen.h | 40 ++
1 file changed, 19 insertions(+), 21 deletions(-)
diff --git a/libavcodec/qdm2_tablegen.h b/libavcodec/qdm2_tablegen.h
index b60989e343..e492f7bb60 100644
--- a/libavcodec/qdm2_tablegen.
Signed-off-by: Andreas Rheinhardt
---
libavcodec/rv40.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c
index 81e08af5f1..7ed599cd69 100644
--- a/libavcodec/rv40.c
+++ b/libavcodec/rv40.c
@@ -41,11 +41,6 @@ static VLC aic_top_
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
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
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
---
configure | 2 +-
libavcodec/mss4.c | 58 +--
2 files changed, 7 insertions(+), 53 deletions(-)
diff --git a/configure b/configure
index 8a9e9b3cd7..4b47832cd7 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
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mss4.c | 73 +++
1 file changed, 29 insertions(+), 44 deletions(-)
diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c
index 9c257dc873..9b343c9b2b 100644
--- a/libavcodec/mss4.c
+++ b/libavcodec/mss4.c
@
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 | 15 +--
1 file changed, 5 insertions(+), 10 deleti
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
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
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
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
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..8ae5d6b8f9 100644
Signed-off-by: Andreas Rheinhardt
---
libavcodec/mpeg4video.h| 4 --
libavcodec/mpeg4videodec.c | 87 --
2 files changed, 36 insertions(+), 55 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
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
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
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
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
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
---
I wonder whether the tables
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/
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
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
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
@@
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
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
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
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 9eb02f88b3..305cc8c075 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -614,7 +614,7 @@ static void rotate_luts(VC1Context *
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
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
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
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 | 66 +--
1 file changed, 29 insertions(+), 37 deletions(-)
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index 09fa962b2f..00fbcef8ec 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@
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 @@
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
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
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 | 69 +-
1 file changed, 34 insertions(+), 35 deletions(-)
diff --git a/libavcodec/atrac9dec.c
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 d2dbffe92a..585c68f33a 100644
--- a/libavcodec/atrac9dec.c
+++ b/libavcodec/atrac9dec.c
@@ -831,7 +831,7 @@ static
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
theora_init_huffman_tables() does essentially the same as
ff_init_vlcs_from_lengths().
Signed-off-by: Andreas Rheinhardt
---
libavcodec/vp3.c | 20 +---
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index f288a53fe1..743d00390c
1 - 100 of 142 matches
Mail list logo