mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 13:10:37 +00:00
Remove redundant checks against MIN_CACHE_BITS
With the removal of the libmpeg2 bitstream reader, MIN_CACHE_BITS
is always >= 25, so tests against smaller values can be removed.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit f162e988aa
)
This commit is contained in:
parent
a4bff12cdd
commit
91d51ee4b5
@ -1062,9 +1062,6 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
|
|||||||
|
|
||||||
UPDATE_CACHE(re, gb);
|
UPDATE_CACHE(re, gb);
|
||||||
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
||||||
#if MIN_CACHE_BITS < 20
|
|
||||||
UPDATE_CACHE(re, gb);
|
|
||||||
#endif
|
|
||||||
cb_idx = cb_vector_idx[code];
|
cb_idx = cb_vector_idx[code];
|
||||||
nnz = cb_idx >> 8 & 15;
|
nnz = cb_idx >> 8 & 15;
|
||||||
bits = SHOW_UBITS(re, gb, nnz) << (32-nnz);
|
bits = SHOW_UBITS(re, gb, nnz) << (32-nnz);
|
||||||
@ -1157,12 +1154,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MIN_CACHE_BITS < 21
|
|
||||||
LAST_SKIP_BITS(re, gb, b + 1);
|
|
||||||
UPDATE_CACHE(re, gb);
|
|
||||||
#else
|
|
||||||
SKIP_BITS(re, gb, b + 1);
|
SKIP_BITS(re, gb, b + 1);
|
||||||
#endif
|
|
||||||
b += 4;
|
b += 4;
|
||||||
n = (1 << b) + SHOW_UBITS(re, gb, b);
|
n = (1 << b) + SHOW_UBITS(re, gb, b);
|
||||||
LAST_SKIP_BITS(re, gb, b);
|
LAST_SKIP_BITS(re, gb, b);
|
||||||
|
@ -718,9 +718,6 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s,
|
|||||||
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
#if MIN_CACHE_BITS < 19
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
|
||||||
#endif
|
|
||||||
/* now quantify & encode AC coefficients */
|
/* now quantify & encode AC coefficients */
|
||||||
for(;;) {
|
for(;;) {
|
||||||
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
|
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
|
||||||
@ -760,14 +757,9 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s,
|
|||||||
}
|
}
|
||||||
|
|
||||||
block[j] = level;
|
block[j] = level;
|
||||||
#if MIN_CACHE_BITS < 19
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
|
||||||
#endif
|
|
||||||
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
||||||
break;
|
break;
|
||||||
#if MIN_CACHE_BITS >= 19
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
UPDATE_CACHE(re, &s->gb);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
LAST_SKIP_BITS(re, &s->gb, 2);
|
LAST_SKIP_BITS(re, &s->gb, 2);
|
||||||
@ -800,9 +792,6 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *bloc
|
|||||||
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
#if MIN_CACHE_BITS < 19
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* now quantify & encode AC coefficients */
|
/* now quantify & encode AC coefficients */
|
||||||
for(;;) {
|
for(;;) {
|
||||||
@ -839,14 +828,9 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *bloc
|
|||||||
}
|
}
|
||||||
|
|
||||||
block[j] = level;
|
block[j] = level;
|
||||||
#if MIN_CACHE_BITS < 19
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
|
||||||
#endif
|
|
||||||
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
||||||
break;
|
break;
|
||||||
#if MIN_CACHE_BITS >= 19
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
UPDATE_CACHE(re, &s->gb);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
LAST_SKIP_BITS(re, &s->gb, 2);
|
LAST_SKIP_BITS(re, &s->gb, 2);
|
||||||
@ -891,9 +875,6 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
|
|||||||
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
#if MIN_CACHE_BITS < 19
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* now quantify & encode AC coefficients */
|
/* now quantify & encode AC coefficients */
|
||||||
for(;;) {
|
for(;;) {
|
||||||
@ -927,14 +908,9 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
|
|||||||
|
|
||||||
mismatch ^= level;
|
mismatch ^= level;
|
||||||
block[j] = level;
|
block[j] = level;
|
||||||
#if MIN_CACHE_BITS < 19
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
|
||||||
#endif
|
|
||||||
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
||||||
break;
|
break;
|
||||||
#if MIN_CACHE_BITS >= 19
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
UPDATE_CACHE(re, &s->gb);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
LAST_SKIP_BITS(re, &s->gb, 2);
|
LAST_SKIP_BITS(re, &s->gb, 2);
|
||||||
@ -969,9 +945,6 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
|
|||||||
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
#if MIN_CACHE_BITS < 19
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* now quantify & encode AC coefficients */
|
/* now quantify & encode AC coefficients */
|
||||||
for(;;) {
|
for(;;) {
|
||||||
@ -1000,14 +973,9 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
|
|||||||
}
|
}
|
||||||
|
|
||||||
block[j] = level;
|
block[j] = level;
|
||||||
#if MIN_CACHE_BITS < 19
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
|
||||||
#endif
|
|
||||||
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
|
||||||
break;
|
break;
|
||||||
#if MIN_CACHE_BITS >=19
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
UPDATE_CACHE(re, &s->gb);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
LAST_SKIP_BITS(re, &s->gb, 2);
|
LAST_SKIP_BITS(re, &s->gb, 2);
|
||||||
|
@ -1023,12 +1023,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
|
|||||||
if(last) i+=192;
|
if(last) i+=192;
|
||||||
} else {
|
} else {
|
||||||
/* second escape */
|
/* second escape */
|
||||||
#if MIN_CACHE_BITS < 20
|
|
||||||
LAST_SKIP_BITS(re, &s->gb, 2);
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
|
||||||
#else
|
|
||||||
SKIP_BITS(re, &s->gb, 2);
|
SKIP_BITS(re, &s->gb, 2);
|
||||||
#endif
|
|
||||||
GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
|
GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
|
||||||
i+= run + rl->max_run[run>>7][level/qmul] +1; //FIXME opt indexing
|
i+= run + rl->max_run[run>>7][level/qmul] +1; //FIXME opt indexing
|
||||||
level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
|
level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
|
||||||
@ -1036,12 +1031,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* first escape */
|
/* first escape */
|
||||||
#if MIN_CACHE_BITS < 19
|
|
||||||
LAST_SKIP_BITS(re, &s->gb, 1);
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
|
||||||
#else
|
|
||||||
SKIP_BITS(re, &s->gb, 1);
|
SKIP_BITS(re, &s->gb, 1);
|
||||||
#endif
|
|
||||||
GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
|
GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
|
||||||
i+= run;
|
i+= run;
|
||||||
level = level + rl->max_level[run>>7][(run-1)&63] * qmul;//FIXME opt indexing
|
level = level + rl->max_level[run>>7][(run-1)&63] * qmul;//FIXME opt indexing
|
||||||
|
@ -1797,12 +1797,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
|
|||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
/* second escape */
|
/* second escape */
|
||||||
#if MIN_CACHE_BITS < 23
|
|
||||||
LAST_SKIP_BITS(re, &s->gb, 2);
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
|
||||||
#else
|
|
||||||
SKIP_BITS(re, &s->gb, 2);
|
SKIP_BITS(re, &s->gb, 2);
|
||||||
#endif
|
|
||||||
GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
|
GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
|
||||||
i+= run + rl->max_run[run>>7][level/qmul] + run_diff; //FIXME opt indexing
|
i+= run + rl->max_run[run>>7][level/qmul] + run_diff; //FIXME opt indexing
|
||||||
level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
|
level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
|
||||||
@ -1816,12 +1811,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* first escape */
|
/* first escape */
|
||||||
#if MIN_CACHE_BITS < 22
|
|
||||||
LAST_SKIP_BITS(re, &s->gb, 1);
|
|
||||||
UPDATE_CACHE(re, &s->gb);
|
|
||||||
#else
|
|
||||||
SKIP_BITS(re, &s->gb, 1);
|
SKIP_BITS(re, &s->gb, 1);
|
||||||
#endif
|
|
||||||
GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
|
GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
|
||||||
i+= run;
|
i+= run;
|
||||||
level = level + rl->max_level[run>>7][(run-1)&63] * qmul;//FIXME opt indexing
|
level = level + rl->max_level[run>>7][(run-1)&63] * qmul;//FIXME opt indexing
|
||||||
|
Loading…
Reference in New Issue
Block a user