You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/vc1: Don't use VLC to read bfraction
The VLC here is very simple, so that it can just be read by two get_bits(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -613,7 +613,10 @@ static void rotate_luts(VC1Context *v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int read_bfraction(VC1Context *v, GetBitContext* gb) {
|
static int read_bfraction(VC1Context *v, GetBitContext* gb) {
|
||||||
int bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
|
int bfraction_lut_index = get_bits(gb, 3);
|
||||||
|
|
||||||
|
if (bfraction_lut_index == 7)
|
||||||
|
bfraction_lut_index = 7 + get_bits(gb, 4);
|
||||||
|
|
||||||
if (bfraction_lut_index == 21) {
|
if (bfraction_lut_index == 21) {
|
||||||
av_log(v->s.avctx, AV_LOG_ERROR, "bfraction invalid\n");
|
av_log(v->s.avctx, AV_LOG_ERROR, "bfraction invalid\n");
|
||||||
@@ -1582,9 +1585,6 @@ static av_cold void vc1_init_static(void)
|
|||||||
{
|
{
|
||||||
static VLCElem vlc_table[32372];
|
static VLCElem vlc_table[32372];
|
||||||
|
|
||||||
INIT_VLC_STATIC(&ff_vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23,
|
|
||||||
ff_vc1_bfraction_bits, 1, 1,
|
|
||||||
ff_vc1_bfraction_codes, 1, 1, 1 << VC1_BFRACTION_VLC_BITS);
|
|
||||||
INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4,
|
INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4,
|
||||||
ff_vc1_norm2_bits, 1, 1,
|
ff_vc1_norm2_bits, 1, 1,
|
||||||
ff_vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS);
|
ff_vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS);
|
||||||
|
@@ -102,8 +102,6 @@ const uint8_t ff_vc1_pquant_table[3][32] = {
|
|||||||
* @todo TODO move this into the context
|
* @todo TODO move this into the context
|
||||||
*/
|
*/
|
||||||
//@{
|
//@{
|
||||||
#define VC1_BFRACTION_VLC_BITS 7
|
|
||||||
VLC ff_vc1_bfraction_vlc;
|
|
||||||
#define VC1_IMODE_VLC_BITS 4
|
#define VC1_IMODE_VLC_BITS 4
|
||||||
VLC ff_vc1_imode_vlc;
|
VLC ff_vc1_imode_vlc;
|
||||||
#define VC1_NORM2_VLC_BITS 3
|
#define VC1_NORM2_VLC_BITS 3
|
||||||
@@ -171,25 +169,6 @@ const int16_t ff_vc1_bfraction_lut[23] = {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const uint8_t ff_vc1_bfraction_bits[23] = {
|
|
||||||
3, 3, 3, 3,
|
|
||||||
3, 3, 3,
|
|
||||||
7, 7, 7, 7,
|
|
||||||
7, 7, 7, 7,
|
|
||||||
7, 7, 7, 7,
|
|
||||||
7, 7,
|
|
||||||
7, 7
|
|
||||||
};
|
|
||||||
const uint8_t ff_vc1_bfraction_codes[23] = {
|
|
||||||
0, 1, 2, 3,
|
|
||||||
4, 5, 6,
|
|
||||||
112, 113, 114, 115,
|
|
||||||
116, 117, 118, 119,
|
|
||||||
120, 121, 122, 123,
|
|
||||||
124, 125,
|
|
||||||
126, 127
|
|
||||||
};
|
|
||||||
|
|
||||||
//Same as H.264
|
//Same as H.264
|
||||||
const AVRational ff_vc1_pixel_aspect[16] = {
|
const AVRational ff_vc1_pixel_aspect[16] = {
|
||||||
{ 0, 1 },
|
{ 0, 1 },
|
||||||
|
@@ -53,8 +53,6 @@ extern const uint8_t ff_vc1_mbmode_intfrp[2][15][4];
|
|||||||
* @todo TODO move this into the context
|
* @todo TODO move this into the context
|
||||||
*/
|
*/
|
||||||
//@{
|
//@{
|
||||||
#define VC1_BFRACTION_VLC_BITS 7
|
|
||||||
extern VLC ff_vc1_bfraction_vlc;
|
|
||||||
#define VC1_IMODE_VLC_BITS 4
|
#define VC1_IMODE_VLC_BITS 4
|
||||||
extern VLC ff_vc1_imode_vlc;
|
extern VLC ff_vc1_imode_vlc;
|
||||||
#define VC1_NORM2_VLC_BITS 3
|
#define VC1_NORM2_VLC_BITS 3
|
||||||
@@ -100,8 +98,6 @@ extern VLC ff_vc1_ac_coeff_table[8];
|
|||||||
|
|
||||||
/* pre-computed scales for all bfractions and base=256 */
|
/* pre-computed scales for all bfractions and base=256 */
|
||||||
extern const int16_t ff_vc1_bfraction_lut[23];
|
extern const int16_t ff_vc1_bfraction_lut[23];
|
||||||
extern const uint8_t ff_vc1_bfraction_bits[23];
|
|
||||||
extern const uint8_t ff_vc1_bfraction_codes[23];
|
|
||||||
|
|
||||||
//Same as H.264
|
//Same as H.264
|
||||||
extern const AVRational ff_vc1_pixel_aspect[16];
|
extern const AVRational ff_vc1_pixel_aspect[16];
|
||||||
|
Reference in New Issue
Block a user