summaryrefslogtreecommitdiff
path: root/libavcodec/rv34data.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-22 12:02:11 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-26 07:16:10 +0100
commit3a836f38f609940d883b8d8ed5e8a526e803da3c (patch)
treef1bf8041f54afebb81b53d7df60e6124f3bb6d81 /libavcodec/rv34data.h
parentf033e6d2e635820ec3deb9b936ed3f27ac7ad0a7 (diff)
avcodec/rv34: Simplify getting right VLC
For both RealVideo 3.0 as well as RealVideo 4.0 the VLC table to use depends upon the slice's quantization parameter; these are coded on five bits in the bitstream and are therefore in the range of 0..31; yet the last element here is not valid and therefore the quantizer is clipped to the range 0..30 to get the index. But this is unnecessary: One can just add one element more to the relevant array to avoid the clipping. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/rv34data.h')
-rw-r--r--libavcodec/rv34data.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/rv34data.h b/libavcodec/rv34data.h
index 4b2701fee6..32ecc395a8 100644
--- a/libavcodec/rv34data.h
+++ b/libavcodec/rv34data.h
@@ -90,13 +90,13 @@ static const uint16_t rv34_qscale_tab[32] = {
/**
* tables used to translate a quantizer value into a VLC set for decoding
- * The first table is used for intraframes.
+ * The first table is used for intraframes. The two last entries are invalid.
*/
-static const uint8_t rv34_quant_to_vlc_set[2][31] = {
+static const uint8_t rv34_quant_to_vlc_set[2][32] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 0 },
+ 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3,
- 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6 },
+ 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6 },
};
/**