* RV30/40 decoder common data
*/
+#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
{
if(mod == 2 && quant < 19) quant += 10;
else if(mod && quant < 26) quant += 5;
- return type ? &inter_vlcs[rv34_quant_to_vlc_set[1][av_clip(quant, 0, 30)]]
- : &intra_vlcs[rv34_quant_to_vlc_set[0][av_clip(quant, 0, 30)]];
+ av_assert2(quant >= 0 && quant < 32);
+ return type ? &inter_vlcs[rv34_quant_to_vlc_set[1][quant]]
+ : &intra_vlcs[rv34_quant_to_vlc_set[0][quant]];
}
/**
/**
* 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 },
};
/**