mirror of https://git.ffmpeg.org/ffmpeg.git
huffyuvdec: remove superfluous check
An invalid entry already has the property of having a negative number of bits, so remove the check on the reserved value, and rearrange the code as a consequence. 346800 decicycles in 422, 262079 runs, 65 skips 168197 decicycles in gray, 262077 runs, 67 skips Overall time: 7.878s 319076 decicycles in 422, 262096 runs, 48 skips 159875 decicycles in gray, 262057 runs, 87 skips Overall time: 7.394s Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
a37020402a
commit
6848325acb
|
@ -586,13 +586,13 @@ static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
|
||||||
|
|
||||||
|
|
||||||
#define GET_VLC_DUAL(dst0, dst1, name, gb, dtable, table1, table2, \
|
#define GET_VLC_DUAL(dst0, dst1, name, gb, dtable, table1, table2, \
|
||||||
bits, max_depth, rsvd ) \
|
bits, max_depth) \
|
||||||
do { \
|
do { \
|
||||||
unsigned int index = SHOW_UBITS(name, gb, bits); \
|
unsigned int index = SHOW_UBITS(name, gb, bits); \
|
||||||
int code = dtable[index][0]; \
|
int code, n = dtable[index][1]; \
|
||||||
int n = dtable[index][1]; \
|
|
||||||
\
|
\
|
||||||
if (code != rsvd && n>0) { \
|
if (n>0) { \
|
||||||
|
code = dtable[index][0]; \
|
||||||
dst0 = code>>8; \
|
dst0 = code>>8; \
|
||||||
dst1 = code; \
|
dst1 = code; \
|
||||||
LAST_SKIP_BITS(name, gb, n); \
|
LAST_SKIP_BITS(name, gb, n); \
|
||||||
|
@ -609,8 +609,7 @@ static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
|
||||||
#define READ_2PIX(dst0, dst1, plane1)\
|
#define READ_2PIX(dst0, dst1, plane1)\
|
||||||
UPDATE_CACHE(re, &s->gb); \
|
UPDATE_CACHE(re, &s->gb); \
|
||||||
GET_VLC_DUAL(dst0, dst1, re, &s->gb, s->vlc[4+plane1].table, \
|
GET_VLC_DUAL(dst0, dst1, re, &s->gb, s->vlc[4+plane1].table, \
|
||||||
s->vlc[0].table, s->vlc[plane1].table, \
|
s->vlc[0].table, s->vlc[plane1].table, VLC_BITS, 3)
|
||||||
VLC_BITS, 3, 0xffff)
|
|
||||||
|
|
||||||
static void decode_422_bitstream(HYuvContext *s, int count)
|
static void decode_422_bitstream(HYuvContext *s, int count)
|
||||||
{
|
{
|
||||||
|
@ -640,8 +639,7 @@ static void decode_422_bitstream(HYuvContext *s, int count)
|
||||||
#define READ_2PIX_PLANE(dst0, dst1, plane) \
|
#define READ_2PIX_PLANE(dst0, dst1, plane) \
|
||||||
UPDATE_CACHE(re, &s->gb); \
|
UPDATE_CACHE(re, &s->gb); \
|
||||||
GET_VLC_DUAL(dst0, dst1, re, &s->gb, s->vlc[4+plane].table, \
|
GET_VLC_DUAL(dst0, dst1, re, &s->gb, s->vlc[4+plane].table, \
|
||||||
s->vlc[plane].table, s->vlc[plane].table, \
|
s->vlc[plane].table, s->vlc[plane].table, VLC_BITS, 3)
|
||||||
VLC_BITS, 3, 0xffff)
|
|
||||||
|
|
||||||
#define READ_2PIX_PLANE14(dst0, dst1, plane){\
|
#define READ_2PIX_PLANE14(dst0, dst1, plane){\
|
||||||
int16_t code = get_vlc2(&s->gb, s->vlc[4+plane].table, VLC_BITS, 1);\
|
int16_t code = get_vlc2(&s->gb, s->vlc[4+plane].table, VLC_BITS, 1);\
|
||||||
|
|
Loading…
Reference in New Issue